From 288b4e4f8f97069db63fdca6f6dddcf56282b03d Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Mon, 9 Dec 2013 17:21:43 +0100 Subject: [PATCH] tls1_heartbeat: check for NULL after allocating buf Signed-off-by: Kurt Roeckx Reviewed-by: Matt Caswell --- ssl/t1_lib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 4133c43ff2..8d5fd12903 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -4094,6 +4094,11 @@ tls1_heartbeat(SSL *s) * - Padding */ buf = OPENSSL_malloc(1 + 2 + payload + padding); + if (buf == NULL) + { + SSLerr(SSL_F_TLS1_HEARTBEAT,ERR_R_MALLOC_FAILURE); + return -1; + } p = buf; /* Message Type */ *p++ = TLS1_HB_REQUEST; -- GitLab