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

Commit d470ded

Browse files
committed
parser: Fix error handling after reaching limit
Mark document as non-wellformed and stop parser even if error limit was reached. Regressed in abd7418.
1 parent 3a648d1 commit d470ded

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

parserInternals.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ xmlCtxtVErr(xmlParserCtxtPtr ctxt, xmlNodePtr node, xmlErrorDomain domain,
253253

254254
if (level == XML_ERR_WARNING) {
255255
if (ctxt->nbWarnings >= XML_MAX_ERRORS)
256-
return;
256+
goto done;
257257
ctxt->nbWarnings += 1;
258258
} else {
259259
if (ctxt->nbErrors >= XML_MAX_ERRORS)
260-
return;
260+
goto done;
261261
ctxt->nbErrors += 1;
262262
}
263263

@@ -308,6 +308,7 @@ xmlCtxtVErr(xmlParserCtxtPtr ctxt, xmlNodePtr node, xmlErrorDomain domain,
308308
return;
309309
}
310310

311+
done:
311312
if (level >= XML_ERR_ERROR)
312313
ctxt->errNo = code;
313314
if (level == XML_ERR_FATAL) {

0 commit comments

Comments
 (0)