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

This commit is contained in:
Takashi Kojo
2024-08-20 10:28:32 +09:00
parent a39f521f7f
commit 4bedef9664

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);