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