From b83dd4e5e8b95f61fa2c25b1635793f919e4f101 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 28 Sep 2022 13:49:41 +0000 Subject: Issue #2010 - Ensure raw tagnames are safe exiting internalEntityParser This resolves #2010 --- parser/expat/lib/xmlparse.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/parser/expat/lib/xmlparse.c b/parser/expat/lib/xmlparse.c index 6ab140c894..34888aba9e 100644 --- a/parser/expat/lib/xmlparse.c +++ b/parser/expat/lib/xmlparse.c @@ -4999,8 +4999,18 @@ internalEntityProcessor(XML_Parser parser, { processor = contentProcessor; /* see externalEntityContentProcessor vs contentProcessor */ - return doContent(parser, parentParser ? 1 : 0, encoding, s, end, - nextPtr, (XML_Bool)!ps_finalBuffer); + result = doContent(parser, + parentParser ? 1 : 0, + encoding, + s, + end, + nextPtr, + (XML_Bool)!ps_finalBuffer); + if (result == XML_ERROR_NONE) { + if (!storeRawNames(parser)) + return XML_ERROR_NO_MEMORY; + } + return result; } } -- cgit v1.2.3