Bug 1412213 - Content-Type MIME-header - Skipping a parameter without an '='. r=mayhemer

This commit is contained in:
Alfred Peters 2018-01-29 14:36:00 -05:00
parent a5927e6ebd
commit a5c14a463b
2 changed files with 11 additions and 1 deletions

View File

@ -470,10 +470,12 @@ nsMIMEHeaderParamImpl::DoParameterInternal(const char *aHeaderValue,
if (!*str) {
break;
}
if (*str++ != '=') {
if (*str != '=') {
// don't accept parameters without "="
goto increment_str;
}
// Skip over '=' only if it was actually there
str++;
while (nsCRT::IsAsciiSpace(*str)) ++str;
if (*str != '"') {

View File

@ -432,6 +432,14 @@ var tests = [
// Bug 783502 - xpcshell test netwerk/test/unit/test_MIME_params.js fails on AddressSanitizer
['attachment; filename="\\b\\a\\',
"attachment", "ba\\"],
// Bug 1412213 - do continue to parse, behind an empty parameter
['attachment; ; filename=foo',
"attachment", "foo"],
// Bug 1412213 - do continue to parse, behind a parameter w/o =
['attachment; badparameter; filename=foo',
"attachment", "foo"],
];
var rfc5987paramtests = [