From: Jonas Maebe Date: Sun, 8 Dec 2013 22:29:43 +0000 (+0100) Subject: dtls1_heartbeat: check for NULL after allocating s->cert->ctypes X-Git-Tag: master-pre-reformat~180 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=241e2dc9362b8d36847c0df00c24e0199234c7c6;p=openssl dtls1_heartbeat: check for NULL after allocating s->cert->ctypes Signed-off-by: Kurt Roeckx Reviewed-by: Richard Levitte --- diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 41ef5cb4f8..877a2bfbc6 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -1481,6 +1481,11 @@ dtls1_heartbeat(SSL *s) * - Padding */ buf = OPENSSL_malloc(1 + 2 + payload + padding); + if (buf == NULL) + { + SSLerr(SSL_F_DTLS1_HEARTBEAT, ERR_R_MALLOC_FAILURE); + return -1; + } p = buf; /* Message Type */ *p++ = TLS1_HB_REQUEST;