From 7ddea353ad3795f7222441274d4d9a155b523cba Mon Sep 17 00:00:00 2001
From: Matthew Fernandez <matthew.fernandez@gmail.com>
Date: Thu, 2 Oct 2025 17:15:15 -0700
Subject: [PATCH] lib: Make a doubling more readable

Suggested-by: Sebastian Pipping <sebastian@pipping.org>

CVE: CVE-2026-25210
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/7ddea353ad3795f7222441274d4d9a155b523cba]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
 lib/xmlparse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/xmlparse.c b/lib/xmlparse.c
index 8cf29257..2f9adffc 100644
--- a/lib/xmlparse.c
+++ b/lib/xmlparse.c
@@ -2977,7 +2977,7 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
             tag->name.strLen = convLen;
             break;
           }
-          bufSize = (int)(tag->bufEnd - tag->buf) << 1;
+          bufSize = (int)(tag->bufEnd - tag->buf) * 2;
           {
             char *temp = (char *)REALLOC(parser, tag->buf, bufSize);
             if (temp == NULL)
