libxml2/libxml2-CVE-2024-40896.patch

20 lines
673 B
Diff
Raw Normal View History

Index: libxml2-2.11.6/parser.c
===================================================================
--- libxml2-2.11.6.orig/parser.c
+++ libxml2-2.11.6/parser.c
@@ -7149,6 +7149,14 @@ xmlParseReference(xmlParserCtxtPtr ctxt)
}
/*
+ * Some users try to parse entities on their own and used to set
+ * the renamed "checked" member. Fix the flags to cover this
+ * case.
+ */
+ if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
+ ent->flags |= XML_ENT_PARSED;
+
+ /*
* The first reference to the entity trigger a parsing phase
* where the ent->children is filled with the result from
* the parsing.