From: Jonas Maebe Date: Sun, 8 Dec 2013 17:12:13 +0000 (+0100) Subject: old_hmac_encode: check for NULL result when allocating *pder X-Git-Tag: master-post-reformat~494 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=34374c2d2c94435a96d98b6527d04417849c0971 old_hmac_encode: check for NULL result when allocating *pder Signed-off-by: Kurt Roeckx Reviewed-by: Rich Salz --- diff --git a/crypto/hmac/hm_ameth.c b/crypto/hmac/hm_ameth.c index a6aa793110..3d998e94da 100644 --- a/crypto/hmac/hm_ameth.c +++ b/crypto/hmac/hm_ameth.c @@ -123,6 +123,8 @@ static int old_hmac_encode(const EVP_PKEY *pkey, unsigned char **pder) if (!*pder) { *pder = OPENSSL_malloc(os->length); + if (*pder == NULL) + return -1; inc = 0; } else inc = 1;