X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fcmp%2Fcmp_msg.c;h=73a9d7a267835351d52bec34ccb0397367ebd056;hp=7fc51596b9a301edcfd6677f99ba39c7491bf4b9;hb=e599d0aecd3e9419d1558628cb42db9cf0fa5fd0;hpb=a81151bd56d55d52c40865f2f135355a2164062e diff --git a/crypto/cmp/cmp_msg.c b/crypto/cmp/cmp_msg.c index 7fc51596b9..73a9d7a267 100644 --- a/crypto/cmp/cmp_msg.c +++ b/crypto/cmp/cmp_msg.c @@ -219,8 +219,13 @@ static OSSL_CRMF_MSG *crm_new(OSSL_CMP_CTX *ctx, int bodytype, int rid) if (rkey == NULL) rkey = ctx->pkey; /* default is independent of ctx->oldClCert */ - if (rkey == NULL - || (bodytype == OSSL_CMP_PKIBODY_KUR && refcert == NULL)) { + if (rkey == NULL) { +#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + CMPerr(0, CMP_R_NULL_ARGUMENT); + return NULL; +#endif + } + if (bodytype == OSSL_CMP_PKIBODY_KUR && refcert == NULL) { CMPerr(0, CMP_R_INVALID_ARGS); return NULL; }