summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2014-04-30 13:51:59 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2014-04-30 13:51:59 +0000
commit28ab924a8460237259a41e693a9d9ed029637d01 (patch)
treeb25f856d984ccf77e90faffa010e0723c8f92bc0 /lib
parent897fdb2e260f2b1ea97183133a309ced8d8d8936 (diff)
Avoid a potential null pointer dereference by checking that we actually
managed to allocate a fragment, before trying to memcpy data into it. ok miod@
Diffstat (limited to 'lib')
-rw-r--r--lib/libssl/src/ssl/d1_both.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libssl/src/ssl/d1_both.c b/lib/libssl/src/ssl/d1_both.c
index 7762ccdee61..db57bf9d3d5 100644
--- a/lib/libssl/src/ssl/d1_both.c
+++ b/lib/libssl/src/ssl/d1_both.c
@@ -1137,6 +1137,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 == NULL)
+ return 0;
memcpy(frag->fragment, s->init_buf->data, s->init_num);