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