From 4bedef9664259046f28f1f501d4188c2689bade2 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 55d20a0c7c..f7388b7ef4 100644 --- a/src/crl.c +++ b/src/crl.c @@ -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);