Skip to content

Commit

Permalink
APPS/cmp_mock_srv.c: prevent crash on ctx->newWithNew being NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
DDvO committed Jul 5, 2024
1 parent 59c415a commit f2ace8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/lib/cmp_mock_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static OSSL_CMP_ITAV *process_genm_itav(mock_srv_ctx *ctx, int req_nid,
if (!OSSL_CMP_ITAV_get0_rootCaCert(req, &rootcacert))
return NULL;

if (rootcacert != NULL
if (rootcacert != NULL && ctx->newWithNew != NULL
&& X509_NAME_cmp(X509_get_subject_name(rootcacert),
X509_get_subject_name(ctx->newWithNew)) != 0)
/* The subjects do not match */
Expand Down

0 comments on commit f2ace8d

Please sign in to comment.