mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-13 13:17:36 +03:00
tree: Set parent->last early in xmlDOMWrapCloneNode
Avoids a corrupted tree in error case.
This commit is contained in:
parent
84e6dc9e5b
commit
e321eba0c7
6
tree.c
6
tree.c
@ -9159,6 +9159,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
|
||||
clone->prev = prevClone;
|
||||
} else
|
||||
parentClone->children = clone;
|
||||
parentClone->last = clone;
|
||||
} else
|
||||
resultClone = clone;
|
||||
|
||||
@ -9515,11 +9516,6 @@ leave_node:
|
||||
prevClone = clone;
|
||||
cur = cur->next;
|
||||
} else if (cur->type != XML_ATTRIBUTE_NODE) {
|
||||
/*
|
||||
* Set clone->last.
|
||||
*/
|
||||
if (clone->parent != NULL)
|
||||
clone->parent->last = clone;
|
||||
clone = clone->parent;
|
||||
if (clone != NULL)
|
||||
parentClone = clone->parent;
|
||||
|
Loading…
x
Reference in New Issue
Block a user