Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions wolfcrypt/src/pkcs7.c
Original file line number Diff line number Diff line change
Expand Up @@ -15319,8 +15319,12 @@ int wc_PKCS7_DecodeAuthEnvelopedData(wc_PKCS7* pkcs7, byte* in,
encryptedContent, encryptedContentSz, encryptedContent,
pkcs7->devId, pkcs7->heap);
if (ret != 0) {
XFREE(encryptedContent, pkcs7->heap, DYNAMIC_TYPE_PKCS7);
return ret;
/* Fall through to the shared error handler below, which
* ForceZeros and frees encryptedContent, nulls
* stream->bufferPt/key, and resets the stream. Returning
* here would leave a dangling stream->bufferPt and risk a
* use-after-free / double-free on streaming re-entry. */
Comment thread
yosuke-wolfssl marked this conversation as resolved.
break;
}

if (encodedAttribs != NULL) {
Expand Down
Loading