From 0533daf5d2747860a2aa636466bcf02972c2dfba Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Fri, 29 Sep 2023 02:45:20 +0200 Subject: [PATCH] encoding: Fix infinite loop in xmlCharEncInput Short-lived regression from 95e81a36. --- encoding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/encoding.c b/encoding.c index bac65acd..be0f31ae 100644 --- a/encoding.c +++ b/encoding.c @@ -2118,8 +2118,8 @@ xmlCharEncInput(xmlParserInputBufferPtr input) avail = xmlBufAvail(out); if (avail > INT_MAX) avail = INT_MAX; - if (avail < toconv * 2) { - if (xmlBufGrow(out, toconv * 2) < 0) { + if (avail < 4096) { + if (xmlBufGrow(out, 4096) < 0) { input->error = XML_ERR_NO_MEMORY; return(XML_ENC_ERR_MEMORY); }