From 1d009fe35d1c5edc6cce5e2b4c21e3a579336cb5 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Mon, 5 Aug 2024 15:14:21 +0200 Subject: [PATCH] parser: Report at least one fatal error --- parserInternals.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parserInternals.c b/parserInternals.c index 4f96625c..eb13be7e 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -330,7 +330,9 @@ xmlCtxtVErr(xmlParserCtxtPtr ctxt, xmlNodePtr node, xmlErrorDomain domain, goto done; ctxt->nbWarnings += 1; } else { - if (ctxt->nbErrors >= XML_MAX_ERRORS) + /* Report at least one fatal error. */ + if ((ctxt->nbErrors >= XML_MAX_ERRORS) && + ((level < XML_ERR_FATAL) || (ctxt->wellFormed == 0))) goto done; ctxt->nbErrors += 1; }