1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00
Files
UXP/parser/expat/12_version_limit.patch
T
Job Bautista a730f838c8 Issue #2889 - Part 5: Rewrite patches for Expat 2.7.3.
- Skipped the fix for BZ 569229 because I don't know where to apply that; the
  processInternalEntity method no longer exists. Hopefully the bug doesn't re-
  appear.
- Previous fixes for 3rd and 13th patches have been merged to their respective
  patches as well.
- 15th patch is now a fix for the 13th and 14th since somewhere between 2.6.4
  and 2.7.3 has made use of a debugging method we don't want to use as well as
  a new boolean method called parserBusy which got mistakenly excluded as an
  unused API while rewriting the 14th patch.
2026-01-14 00:03:54 +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;