From 34374c2d2c94435a96d98b6527d04417849c0971 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 8 Dec 2013 18:12:13 +0100 Subject: [PATCH] old_hmac_encode: check for NULL result when allocating *pder Signed-off-by: Kurt Roeckx Reviewed-by: Rich Salz --- crypto/hmac/hm_ameth.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.25.1