forked from wolfSSL/wolfssl
Merge pull request #2109 from dgarske/pkcs7_buf
Fix for proper detection of PKCS7 buffer overflow case
This commit is contained in:
@ -2068,6 +2068,10 @@ static int PKCS7_EncodeSigned(PKCS7* pkcs7, ESD* esd,
|
|||||||
totalSz -= pkcs7->contentSz;
|
totalSz -= pkcs7->contentSz;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
/* if using single output buffer include content and footer */
|
||||||
|
totalSz += total2Sz;
|
||||||
|
}
|
||||||
|
|
||||||
if (totalSz > *outputSz) {
|
if (totalSz > *outputSz) {
|
||||||
if (pkcs7->signedAttribsSz != 0)
|
if (pkcs7->signedAttribsSz != 0)
|
||||||
|
Reference in New Issue
Block a user