Fix CID 1467068 : Null pointer dereference in self_test.c

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12930)
This commit is contained in:
Shane Lontis 2020-09-21 10:47:03 +10:00
parent 2e9ab56edc
commit 78ef571707

View File

@ -174,8 +174,10 @@ static int verify_integrity(OSSL_CORE_BIO *bio, OSSL_FUNC_BIO_read_ex_fn read_ex
OSSL_SELF_TEST_onbegin(ev, event_type, OSSL_SELF_TEST_DESC_INTEGRITY_HMAC);
mac = EVP_MAC_fetch(libctx, MAC_NAME, NULL);
if (mac == NULL)
goto err;
ctx = EVP_MAC_CTX_new(mac);
if (mac == NULL || ctx == NULL)
if (ctx == NULL)
goto err;
*p++ = OSSL_PARAM_construct_utf8_string("digest", DIGEST_NAME,