aboutsummaryrefslogtreecommitdiffstats
path: root/main/libxml2/CVE-2021-3518.patch
blob: 3ed2a68e8d7de2928edd29c394fae6e2caf8f033 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff -urN libxml2-2.9.10.orig/xinclude.c libxml2-2.9.10/xinclude.c
--- libxml2-2.9.10.orig/xinclude.c	2021-06-04 10:26:43.173188644 -0600
+++ libxml2-2.9.10/xinclude.c	2021-06-04 10:28:19.633720058 -0600
@@ -2397,9 +2397,8 @@
     while ((cur != NULL) && (cur != tree->parent)) {
 	/* TODO: need to work on entities -> stack */
 	if ((cur->children != NULL) &&
-	    (cur->children->type != XML_ENTITY_DECL) &&
-	    (cur->children->type != XML_XINCLUDE_START) &&
-	    (cur->children->type != XML_XINCLUDE_END)) {
+            ((cur->type == XML_DOCUMENT_NODE) ||
+             (cur->type == XML_ELEMENT_NODE))) {
 	    cur = cur->children;
 	    if (xmlXIncludeTestNode(ctxt, cur))
 		xmlXIncludePreProcessNode(ctxt, cur);