Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit e30cb63

Browse files
committed
parser: Fix error return of xmlParseBalancedChunkMemory
Only return an error code if the chunk is not well-formed to match the 2.12 behavior. Return 0 on non-fatal errors like invalid namespaces. Fixes #765.
1 parent dd5adf5 commit e30cb63

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

parser.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12535,7 +12535,10 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
1253512535
else
1253612536
xmlFreeNodeList(list);
1253712537

12538-
ret = ctxt->errNo;
12538+
if (!ctxt->wellFormed)
12539+
ret = ctxt->errNo;
12540+
else
12541+
ret = XML_ERR_OK;
1253912542

1254012543
xmlFreeInputStream(input);
1254112544
xmlFreeParserCtxt(ctxt);

0 commit comments

Comments
 (0)