From cae088936cbff84f77d9f54bb97baeb977fea634 Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Tue, 20 Aug 2024 10:28:32 +0900 Subject: [PATCH] allow sigParamsSz is zero and malloc(0) to return NULL --- src/crl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crl.c b/src/crl.c index 706c1f6489..2b24b2667f 100644 --- a/src/crl.c +++ b/src/crl.c @@ -779,7 +779,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);