Skip to content

Commit bcda764

Browse files
committed
xmlreader: Fix return value of xmlTextReaderReadString
Return NULL if the node has no children or the children were already deleted to match the 2.12 behavior. Fixes #817.
1 parent 5cce7af commit bcda764

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xmlreader.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,8 @@ xmlTextReaderReadString(xmlTextReaderPtr reader)
17501750
case XML_CDATA_SECTION_NODE:
17511751
break;
17521752
case XML_ELEMENT_NODE:
1753-
if (xmlTextReaderDoExpand(reader) == -1)
1753+
if ((xmlTextReaderDoExpand(reader) == -1) ||
1754+
(node->children == NULL))
17541755
return(NULL);
17551756
break;
17561757
case XML_ATTRIBUTE_NODE:

0 commit comments

Comments
 (0)