b2d3a8
diff -up firefox-91.7.0/parser/expat/lib/xmltok.c.expat-CVE-2022-25235 firefox-91.7.0/parser/expat/lib/xmltok.c
b2d3a8
--- firefox-91.7.0/parser/expat/lib/xmltok.c.expat-CVE-2022-25235	2022-03-02 17:57:38.364361168 +0100
b2d3a8
+++ firefox-91.7.0/parser/expat/lib/xmltok.c	2022-03-02 17:58:22.235512399 +0100
b2d3a8
@@ -65,13 +65,6 @@
b2d3a8
                       + ((((byte)[2]) >> 5) & 1)] \
b2d3a8
          & (1u << (((byte)[2]) & 0x1F)))
b2d3a8
 
b2d3a8
-#define UTF8_GET_NAMING(pages, p, n) \
b2d3a8
-  ((n) == 2 \
b2d3a8
-  ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \
b2d3a8
-  : ((n) == 3 \
b2d3a8
-     ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) \
b2d3a8
-     : 0))
b2d3a8
-
b2d3a8
 /* Detection of invalid UTF-8 sequences is based on Table 3.1B
b2d3a8
    of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/
b2d3a8
    with the additional restriction of not allowing the Unicode
b2d3a8
diff -up firefox-91.7.0/parser/expat/lib/xmltok_impl.c.expat-CVE-2022-25235 firefox-91.7.0/parser/expat/lib/xmltok_impl.c
b2d3a8
--- firefox-91.7.0/parser/expat/lib/xmltok_impl.c.expat-CVE-2022-25235	2022-03-02 17:57:38.365361172 +0100
b2d3a8
+++ firefox-91.7.0/parser/expat/lib/xmltok_impl.c	2022-03-02 18:04:51.240853247 +0100
b2d3a8
@@ -34,7 +34,7 @@
b2d3a8
    case BT_LEAD ## n: \
b2d3a8
      if (end - ptr < n) \
b2d3a8
        return XML_TOK_PARTIAL_CHAR; \
b2d3a8
-     if (!IS_NAME_CHAR(enc, ptr, n)) { \
b2d3a8
+     if (IS_INVALID_CHAR(enc, ptr, n) || ! IS_NAME_CHAR(enc, ptr, n)) { \
b2d3a8
        *nextTokPtr = ptr; \
b2d3a8
        return XML_TOK_INVALID; \
b2d3a8
      } \
b2d3a8
@@ -62,7 +62,7 @@
b2d3a8
    case BT_LEAD ## n: \
b2d3a8
      if (end - ptr < n) \
b2d3a8
        return XML_TOK_PARTIAL_CHAR; \
b2d3a8
-     if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \
b2d3a8
+     if (IS_INVALID_CHAR(enc, ptr, n) || ! IS_NMSTRT_CHAR(enc, ptr, n)) { \
b2d3a8
        *nextTokPtr = ptr; \
b2d3a8
        return XML_TOK_INVALID; \
b2d3a8
      } \
b2d3a8
@@ -1090,6 +1090,10 @@ PREFIX(prologTok)(const ENCODING *enc, c
b2d3a8
   case BT_LEAD ## n: \
b2d3a8
     if (end - ptr < n) \
b2d3a8
       return XML_TOK_PARTIAL_CHAR; \
b2d3a8
+    if (IS_INVALID_CHAR(enc, ptr, n)) {                                        \
b2d3a8
+      *nextTokPtr = ptr;                                                       \
b2d3a8
+      return XML_TOK_INVALID;                                                  \
b2d3a8
+    }                                                                          \
b2d3a8
     if (IS_NMSTRT_CHAR(enc, ptr, n)) { \
b2d3a8
       ptr += n; \
b2d3a8
       tok = XML_TOK_NAME; \