mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-13 13:17:36 +03:00
tree: Check destParent->doc in xmlDOMWrapCloneNode
The document must match destDoc to avoid tree corruption.
This commit is contained in:
parent
7c48c01b1c
commit
37556eb32a
3
tree.c
3
tree.c
@ -8990,7 +8990,8 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
|
||||
xmlNsPtr cloneNs = NULL, *cloneNsDefSlot = NULL;
|
||||
xmlDictPtr dict; /* The destination dict */
|
||||
|
||||
if ((node == NULL) || (resNode == NULL) || (destDoc == NULL))
|
||||
if ((node == NULL) || (resNode == NULL) || (destDoc == NULL) ||
|
||||
((destParent != NULL) && (destParent->doc != destDoc)))
|
||||
return(-1);
|
||||
/*
|
||||
* TODO: Initially we support only element-nodes.
|
||||
|
Loading…
x
Reference in New Issue
Block a user