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