diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-08-11 15:36:49 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-08-24 11:19:28 +1000 |
commit | ab7f4a3d2b86ef564081df7219301f7874c4d8af (patch) | |
tree | 14f7d78b3a2c7740972cdd749ffbd6b31742c611 /test/evp_test.c | |
parent | 61d61c5fd227903bb34562fc06531e91e9453f64 (diff) |
Fix coverity CID #1465790 - Dereference after NULL check in evp_test.c
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12628)
Diffstat (limited to 'test/evp_test.c')
-rw-r--r-- | test/evp_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/evp_test.c b/test/evp_test.c index 958718b1ba..adcfea0038 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; |