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