From 853db0841f69e79e94a5c896c08316f6bbd12270 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 5 May 2022 16:25:28 -0600 Subject: [PATCH] fix for indef buffer check with pkcs7 --- wolfcrypt/src/pkcs7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index fcea611fc..a31b4bae6 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -360,7 +360,7 @@ static int wc_PKCS7_SetMaxStream(PKCS7* pkcs7, byte* in, word32 defSz) #ifdef ASN_BER_TO_DER if (length == 0 && ret == 0) { idx = 0; - if ((ret = wc_BerToDer(pt, defSz, NULL, + if ((ret = wc_BerToDer(pt, maxIdx, NULL, (word32*)&length)) != LENGTH_ONLY_E) { return ret; }