cmp_vfy_test.c: Avoid NULL pointer dereference

Fixes Coverity 1619463

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25503)
This commit is contained in:
Tomas Mraz 2024-09-20 14:42:52 +02:00
parent 445017152b
commit 5bc13d5d8c

View File

@ -336,8 +336,9 @@ static int test_validate_msg_signature_sender_cert_extracert(void)
|| !add_trusted(fixture->cmp_ctx, instaca_cert)) {
tear_down(fixture);
fixture = NULL;
} else {
fixture->cert = sk_X509_value(fixture->msg->extraCerts, 1); /* Insta CA */
}
fixture->cert = sk_X509_value(fixture->msg->extraCerts, 1); /* Insta CA */
EXECUTE_TEST(execute_validate_msg_test, tear_down);
return result;
}