From: Jonas Maebe Date: Sun, 8 Dec 2013 22:29:17 +0000 (+0100) Subject: dtls1_process_heartbeat: check for NULL after allocating buffer X-Git-Tag: master-pre-reformat~181 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d15f5df70d890f9bd71a4d665699cb96f441f741;p=openssl dtls1_process_heartbeat: check for NULL after allocating buffer Signed-off-by: Kurt Roeckx Reviewed-by: Richard Levitte --- 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 */