Skip to content

Commit 27f6aa8

Browse files
committed
PPrintXMLTree: avoids infinite loop on root node with no content
1 parent 14223a9 commit 27f6aa8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pprint.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,9 +2586,12 @@ void TY_(PPrintXMLTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node )
25862586
}
25872587
else if ( node->type == RootNode )
25882588
{
2589-
if (node->content)
2589+
if (node->content) {
25902590
node = node->content;
2591-
continue;
2591+
continue;
2592+
} else {
2593+
break;
2594+
}
25922595
}
25932596
else if ( node->type == CommentTag )
25942597
{

0 commit comments

Comments
 (0)