71fa08
diff -up thunderbird-91.7.0/parser/expat/lib/xmlparse.c.expat-CVE-2022-25236 thunderbird-91.7.0/parser/expat/lib/xmlparse.c
71fa08
--- thunderbird-91.7.0/parser/expat/lib/xmlparse.c.expat-CVE-2022-25236	2022-03-02 18:08:40.085642028 +0100
71fa08
+++ thunderbird-91.7.0/parser/expat/lib/xmlparse.c	2022-03-02 18:13:31.838667958 +0100
71fa08
@@ -700,8 +700,7 @@ XML_ParserCreate(const XML_Char *encodin
71fa08
 XML_Parser XMLCALL
71fa08
 XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep)
71fa08
 {
71fa08
-  XML_Char tmp[2];
71fa08
-  *tmp = nsSep;
71fa08
+  XML_Char tmp[2] = {nsSep, 0};
71fa08
   return XML_ParserCreate_MM(encodingName, NULL, tmp);
71fa08
 }
71fa08
 #endif
71fa08
@@ -1276,8 +1275,7 @@ XML_ExternalEntityParserCreate(XML_Parse
71fa08
      would be otherwise.
71fa08
   */
71fa08
   if (ns) {
71fa08
-    XML_Char tmp[2];
71fa08
-    *tmp = namespaceSeparator;
71fa08
+    XML_Char tmp[2] = {parser->m_namespaceSeparator, 0};
71fa08
     parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
71fa08
   }
71fa08
   else {
71fa08
@@ -3667,6 +3665,16 @@ addBinding(XML_Parser parser, PREFIX *pr
71fa08
     if (!mustBeXML && isXMLNS
71fa08
         && (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
71fa08
       isXMLNS = XML_FALSE;
71fa08
+    // NOTE: While Expat does not validate namespace URIs against RFC 3986,
71fa08
+    //       we have to at least make sure that the XML processor on top of
71fa08
+    //       Expat (that is splitting tag names by namespace separator into
71fa08
+    //       2- or 3-tuples (uri-local or uri-local-prefix)) cannot be confused
71fa08
+    //       by an attacker putting additional namespace separator characters
71fa08
+    //       into namespace declarations.  That would be ambiguous and not to
71fa08
+    //       be expected.
71fa08
+    if (parser->m_ns && (uri[len] == parser->m_namespaceSeparator)) {
71fa08
+      return XML_ERROR_SYNTAX;
71fa08
+    }
71fa08
   }
71fa08
   isXML = isXML && len == xmlLen;
71fa08
   isXMLNS = isXMLNS && len == xmlnsLen;