dtls1_process_heartbeat: check for NULL after allocating buffer

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Jonas Maebe 2013-12-08 23:29:17 +01:00 committed by Kurt Roeckx
parent b1a08ac71f
commit d15f5df70d

View File

@ -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 */