From 66e9fd66e8fbc23063640ed466ca0eef64bc088c Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sun, 25 Dec 2022 21:26:17 +0100 Subject: [PATCH] parser: Fix infinite loop with push parser in recovery mode Short-lived regression from commit b1f9c193. Found by OSS-Fuzz. --- parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser.c b/parser.c index 34a3c865..5dd17a42 100644 --- a/parser.c +++ b/parser.c @@ -11836,7 +11836,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { size = XML_PARSER_BIG_BUFFER_SIZE; } tmp = xmlCheckCdataPush(ctxt->input->cur, size, 0); - if (tmp < 0) { + if (tmp <= 0) { tmp = -tmp; ctxt->input->cur += tmp; goto encoding_error;