From d15f5df70d890f9bd71a4d665699cb96f441f741 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 8 Dec 2013 23:29:17 +0100 Subject: [PATCH] dtls1_process_heartbeat: check for NULL after allocating buffer Signed-off-by: Kurt Roeckx Reviewed-by: Richard Levitte --- ssl/d1_both.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 82e814ae6f..41ef5cb4f8 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -1392,6 +1392,8 @@ dtls1_process_heartbeat(SSL *s) * payload, plus padding */ buffer = OPENSSL_malloc(write_length); + if (buffer == NULL) + return -1; bp = buffer; /* Enter response type, length and copy payload */ -- GitLab