From dafcefb22814de86260b169c399fa9c3e15ef74e Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Mon, 25 Nov 2024 22:22:26 +0100 Subject: [PATCH] parser: Fail on catastrophic errors in recovery mode --- parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index 7fb4af39..d5992f3e 100644 --- a/parser.c +++ b/parser.c @@ -12018,7 +12018,7 @@ xmlCtxtParseContentInternal(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL); if ((ctxt->wellFormed) || - ((ctxt->recovery) && (ctxt->errNo != XML_ERR_NO_MEMORY))) { + ((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) { if (root != NULL) { xmlNodePtr cur; @@ -13836,7 +13836,7 @@ xmlCtxtParseDocument(xmlParserCtxtPtr ctxt, xmlParserInputPtr input) xmlParseDocument(ctxt); if ((ctxt->wellFormed) || - ((ctxt->recovery) && (ctxt->errNo != XML_ERR_NO_MEMORY))) { + ((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) { ret = ctxt->myDoc; } else { if (ctxt->errNo == XML_ERR_OK)