summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Maebe <jonas.maebe@elis.ugent.be>2013-12-08 18:12:13 +0100
committerKurt Roeckx <kurt@roeckx.be>2014-08-17 18:52:44 +0200
commit34374c2d2c94435a96d98b6527d04417849c0971 (patch)
tree63e27e492e845b42f57c79b92d4b0ad48abc4216
parent6f77f82bfcdf40c41e095bf292e887d15f2bf69d (diff)
old_hmac_encode: check for NULL result when allocating *pder
Signed-off-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
-rw-r--r--crypto/hmac/hm_ameth.c2
1 files changed, 2 insertions, 0 deletions
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;