From: Shane Lontis Date: Tue, 11 Aug 2020 05:36:49 +0000 (+1000) Subject: Fix coverity CID #1465790 - Dereference after NULL check in evp_test.c X-Git-Tag: openssl-3.0.0-alpha7~507 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab7f4a3d2b86ef564081df7219301f7874c4d8af;p=thirdparty%2Fopenssl.git Fix coverity CID #1465790 - Dereference after NULL check in evp_test.c Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/12628) --- diff --git a/test/evp_test.c b/test/evp_test.c index 958718b1ba7..adcfea00383 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -1151,7 +1151,7 @@ static int mac_test_run_pkey(EVP_TEST *t) OBJ_nid2sn(expected->type), expected->alg); if (expected->type == EVP_PKEY_CMAC) { - if (is_cipher_disabled(expected->alg)) { + if (expected->alg != NULL && is_cipher_disabled(expected->alg)) { TEST_info("skipping, PKEY CMAC '%s' is disabled", expected->alg); t->skip = 1; t->err = NULL; @@ -1174,7 +1174,7 @@ static int mac_test_run_pkey(EVP_TEST *t) goto err; } - if (expected->type == EVP_PKEY_HMAC) { + if (expected->type == EVP_PKEY_HMAC && expected->alg != NULL) { if (is_digest_disabled(expected->alg)) { TEST_info("skipping, HMAC '%s' is disabled", expected->alg); t->skip = 1;