summaryrefslogtreecommitdiff
path: root/src/lxml/includes
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2019-02-05 21:31:02 +0100
committerStefan Behnel <stefan_ml@behnel.de>2019-02-05 21:31:02 +0100
commit201b712edf0478e6a94ace984c1e8435bf3bc3c3 (patch)
tree1ebf9a07fd10d3f17aa423d11294bdb58b7627f0 /src/lxml/includes
parent7303cadd01b81fceb40f74148a5b9b6178936768 (diff)
downloadpython-lxml-201b712edf0478e6a94ace984c1e8435bf3bc3c3.tar.gz
LP#1814522: Fix a crash when appending a child subtree that contains unsubstituted entity references.
This is a work-around for a (supposed) bug in libxml2 (https://gitlab.gnome.org/GNOME/libxml2/issues/42), which crashes by running into an infinite recursive loop while traversing the child nodes of the entity reference. A lucky side effect is that the previously duplicated cleanup traversal to a) update the .doc pointers in libxml2 and b) update the dict names in lxml is now replaced by a single traversal, which should speed things up for large subtrees.
Diffstat (limited to 'src/lxml/includes')
-rw-r--r--src/lxml/includes/tree.pxd2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lxml/includes/tree.pxd b/src/lxml/includes/tree.pxd
index 0d9d8843..fb47473c 100644
--- a/src/lxml/includes/tree.pxd
+++ b/src/lxml/includes/tree.pxd
@@ -286,6 +286,7 @@ cdef extern from "libxml/tree.h":
xmlAttr* prev
xmlDoc* doc
xmlNs* ns
+ xmlAttributeType atype
ctypedef struct xmlID:
const_xmlChar* value
@@ -334,6 +335,7 @@ cdef extern from "libxml/tree.h":
cdef xmlAttr* xmlSetProp(xmlNode* node, const_xmlChar* name, const_xmlChar* value) nogil
cdef xmlAttr* xmlSetNsProp(xmlNode* node, xmlNs* ns,
const_xmlChar* name, const_xmlChar* value) nogil
+ cdef int xmlRemoveID(xmlDoc* doc, xmlAttr* cur) nogil
cdef int xmlRemoveProp(xmlAttr* cur) nogil
cdef xmlChar* xmlGetNodePath(xmlNode* node) nogil
cdef void xmlDocDumpMemory(xmlDoc* cur, char** mem, int* size) nogil