Files
basilisk55/parser/expat/12_version_limit.patch
roytam1 ee15f2005b import from UXP:
- Issue #2889 - Part 0: Relocate Mozilla-specific files from Expat source. (b81b97ee)
- Issue #2889 - Part 1: Prepare Mozilla's changes and extensions for Expat 2.6.4. (95676016)
- Issue #2889 - Part 2: Import Expat 2.6.4 source. (9ade98b4)
- Issue #2889 - Part 3: Apply Mozilla's patches to Expat 2.6.4. (0b9e221b)
- Issue #2889 - Part 4: Fix build and runtime issues. (a2f8e661)
- Issue #2889 - Follow-up: Avoid conflicts with system version of libexpat (e0f8acdd)
- Issue #2889 - Follow-up: void methods shouldn't return a value. (8956c611)
- Issue #2889 - Part 5: Rewrite patches for Expat 2.7.3. (a730f838)
- Issue #2889 - Part 6: Import Expat 2.7.3 source. (d2acec73)
- Issue #2889 - Part 7: Apply patches to Expat 2.7.3. (ca2ef518)
- Issue #2889 - Follow-up: Allow generate_hash_secret_salt to be used. (acefed74)
- Issue #2889 - Follow-up: Adjust Expat 2.7.3 local patches for removal of 3rd patch. (034eeaff)
- Issue #2889 - Follow-up: Remove fix for BZ 569229. (493169e2)
2026-01-14 09:18:57 +08:00

34 lines
1.1 KiB
Diff

diff --git a/lib/xmltok.c b/lib/xmltok.c
--- a/lib/xmltok.c
+++ b/lib/xmltok.c
@@ -1148,6 +1148,12 @@
static const char KW_no[] = {ASCII_n, ASCII_o, '\0'};
+#ifdef MOZILLA_CLIENT
+/* Bug 62157 - Document content is rendered even though version value is
+ not "1.0" */
+static const char KW_XML_1_0[] = {ASCII_1, ASCII_PERIOD, ASCII_0, '\0'};
+#endif
+
static int
doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *, const char *,
const char *),
@@ -1175,6 +1181,16 @@
*versionPtr = val;
if (versionEndPtr)
*versionEndPtr = ptr;
+#ifdef MOZILLA_CLIENT
+/* Bug 62157 - Document content is rendered even though version value is
+ not "1.0") */
+ /* Anything else but a version="1.0" is invalid for us, until we support
+ later versions. */
+ if (!XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_XML_1_0)) {
+ *badPtr = val;
+ return 0;
+ }
+#endif
if (! parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) {
*badPtr = ptr;
return 0;