allow sigParamsSz is zero and malloc(0) to return NULL

pull/7887/head
Takashi Kojo 2024-08-20 10:28:32 +09:00
parent a39f521f7f
commit 4bedef9664
1 changed files with 2 additions and 1 deletions

View File

@ -777,7 +777,8 @@ static CRL_Entry* DupCRL_Entry(const CRL_Entry* ent, void* heap)
#endif
if (dupl->toBeSigned == NULL || dupl->signature == NULL
#ifdef WC_RSA_PSS
|| dupl->sigParams == NULL
/* allow sigParamsSz is zero and malloc(0) to return NULL */
|| (dupl->sigParams == NULL && dupl->sigParamsSz != 0)
#endif
) {
CRL_Entry_free(dupl, heap);