Bug 345580 - Problem decoding quoted-printable question mark in subject r=biesi

This commit is contained in:
Andrew Sutherland 2016-01-28 14:25:46 -05:00
parent a06b332716
commit dd7d08ab97

View File

@ -1238,13 +1238,14 @@ nsresult DecodeRFC2047Str(const char *aHeader, const char *aDefaultCharset,
if (q[1] != '?')
goto badsyntax;
r = q;
for (r = q + 2; *r != '?'; r++) {
// loop-wise, keep going until we hit "?=". the inner check handles the
// nul terminator should the string terminate before we hit the right
// marker. (And the r[1] will never reach beyond the end of the string
// because *r != '?' is true if r is the nul character.)
for (r = q + 2; *r != '?' || r[1] != '='; r++) {
if (*r < ' ') goto badsyntax;
}
if (r[1] != '=')
goto badsyntax;
else if (r == q + 2) {
if (r == q + 2) {
// it's empty, skip
begin = r + 2;
isLastEncodedWord = 1;