From 0345354fe0177e73509b4d2979dc6a5f869e9dc6 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Tue, 10 Jun 2014 14:47:29 +0100 Subject: [PATCH] Fix null pointer errors. PR#3394 (cherry picked from commit 7a9d59c148b773f59a41f8697eeecf369a0974c2) --- crypto/ocsp/ocsp_ht.c | 3 +++ ssl/d1_both.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/crypto/ocsp/ocsp_ht.c b/crypto/ocsp/ocsp_ht.c index 92aba08c8f..fb87cd764b 100644 --- a/crypto/ocsp/ocsp_ht.c +++ b/crypto/ocsp/ocsp_ht.c @@ -464,6 +464,9 @@ OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req) ctx = OCSP_sendreq_new(b, path, req, -1); + if (!ctx) + return NULL; + do { rv = OCSP_sendreq_nbio(&resp, ctx); diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 61867b3e33..fe3a96cd25 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -1173,6 +1173,8 @@ dtls1_buffer_message(SSL *s, int is_ccs) OPENSSL_assert(s->init_off == 0); frag = dtls1_hm_fragment_new(s->init_num, 0); + if (!frag) + return 0; memcpy(frag->fragment, s->init_buf->data, s->init_num); -- 2.25.1