From f2ace8ded4c72f74467418ff78d3e9c0c37afecd Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Fri, 5 Jul 2024 13:37:25 +0200 Subject: [PATCH] APPS/cmp_mock_srv.c: prevent crash on ctx->newWithNew being NULL --- apps/lib/cmp_mock_srv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/lib/cmp_mock_srv.c b/apps/lib/cmp_mock_srv.c index ce62af2b007aa4..516b1870b0ebb2 100644 --- a/apps/lib/cmp_mock_srv.c +++ b/apps/lib/cmp_mock_srv.c @@ -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 */