Skip to content

Commit f7e46d9

Browse files
authored
Merge pull request htacg#1011 from catenacyber/next
PPrintXMLTree: avoids infinite loop on root node with no content
2 parents 14223a9 + 27f6aa8 commit f7e46d9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pprint.c

+5-2
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)