Merge pull request #4233 from JacobBarthelmeh/fuzzing

fix memory leak with SMIME
This commit is contained in:
kabuobeid
2021-07-23 10:26:02 -07:00
committed by GitHub

View File

@@ -19001,6 +19001,8 @@ int wc_MIME_parse_headers(char* in, int inLen, MimeHdr** headers)
mimeType == MIME_PARAM)) && pos >= 1) {
mimeStatus = MIME_BODYVAL;
end = pos-1;
if (nameAttr != NULL)
XFREE(nameAttr, NULL, DYNAMIC_TYPE_PKCS7);
ret = wc_MIME_header_strip(curLine, &nameAttr, start, end);
if (ret) {
goto error;
@@ -19009,6 +19011,8 @@ int wc_MIME_parse_headers(char* in, int inLen, MimeHdr** headers)
}
else if (mimeStatus == MIME_BODYVAL && cur == ';' && pos >= 1) {
end = pos-1;
if (bodyVal != NULL)
XFREE(bodyVal, NULL, DYNAMIC_TYPE_PKCS7);
ret = wc_MIME_header_strip(curLine, &bodyVal, start, end);
if (ret) {
goto error;