From cba8a7f1559f89f0da49406a43406b1a5570e954 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 5 Jun 2019 08:13:35 +0700 Subject: [PATCH] free buffer when using small stack --- wolfcrypt/src/pkcs7.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 6159bc44f..e33fcb7a7 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -3358,6 +3358,9 @@ static int wc_PKCS7_SignedDataVerifySignature(PKCS7* pkcs7, byte* sig, XMEMCPY(pkcs7->pkcs7Digest, pkcs7Digest, pkcs7DigestSz); pkcs7->pkcs7DigestSz = pkcs7DigestSz; + #ifdef WOLFSSL_SMALL_STACK + XFREE(pkcs7Digest, pkcs7->heap, DYNAMIC_TYPE_TMP_BUFFER); + #endif return PKCS7_SIGNEEDS_CHECK; } }