From 241e2dc9362b8d36847c0df00c24e0199234c7c6 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 8 Dec 2013 23:29:43 +0100 Subject: [PATCH] dtls1_heartbeat: check for NULL after allocating s->cert->ctypes Signed-off-by: Kurt Roeckx Reviewed-by: Richard Levitte --- ssl/d1_both.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.25.1