12_version_limit.patch (1225B)
1 diff --git a/expat/lib/xmltok.c b/expat/lib/xmltok.c 2 --- a/expat/lib/xmltok.c 3 +++ b/expat/lib/xmltok.c 4 @@ -1148,6 +1148,10 @@ static const char KW_yes[] = {ASCII_y, A 5 6 static const char KW_no[] = {ASCII_n, ASCII_o, '\0'}; 7 8 +/* BEGIN MOZILLA CHANGE (Bug 62157 - Document content is rendered even though version value is not "1.0") */ 9 +static const char KW_XML_1_0[] = {ASCII_1, ASCII_PERIOD, ASCII_0, '\0'}; 10 +/* END MOZILLA CHANGE */ 11 + 12 static int 13 doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *, const char *, 14 const char *), 15 @@ -1175,6 +1179,13 @@ doParseXmlDecl(const ENCODING *(*encodin 16 *versionPtr = val; 17 if (versionEndPtr) 18 *versionEndPtr = ptr; 19 +/* BEGIN MOZILLA CHANGE (Bug 62157 - Document content is rendered even though version value is not "1.0") */ 20 + /* Anything else but a version="1.0" is invalid for us, until we support later versions. */ 21 + if (!XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_XML_1_0)) { 22 + *badPtr = val; 23 + return 0; 24 + } 25 +/* END MOZILLA CHANGE */ 26 if (! parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { 27 *badPtr = ptr; 28 return 0;