summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pugixml.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index bf3346b..d140425 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -4423,6 +4423,7 @@ PUGI__NS_BEGIN
while (sit && sit != sn)
{
+ // when a tree is copied into one of the descendants, we need to skip that subtree to avoid an infinite loop
if (sit != dn)
{
xml_node_struct* copy = append_new_node(dit, alloc, PUGI__NODETYPE(sit));