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