old_hmac_encode: check for NULL result when allocating *pder
authorJonas Maebe <jonas.maebe@elis.ugent.be>
Sun, 8 Dec 2013 17:12:13 +0000 (18:12 +0100)
committerKurt Roeckx <kurt@roeckx.be>
Sun, 17 Aug 2014 16:52:44 +0000 (18:52 +0200)
Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/hmac/hm_ameth.c

index a6aa7931108c6d5ab4d222da1de53edb3782977c..3d998e94da861f0ea20a17a324d927614b10134d 100644 (file)
@@ -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;