summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2022-09-11 21:01:20 +0200
committerGitHub <noreply@github.com>2022-09-11 21:01:20 +0200
commitdde178b976934e16526a3277d31d9fa3fab7a6c1 (patch)
tree43f6398b83d3e69570379761807477d919bdafff
parent528dbea4ee3c5bdc549c7e97aedd44c21a209cd0 (diff)
parent4a32da87e931ba54393d465bb77c40b5c33d343b (diff)
downloadlibexpat-git-dde178b976934e16526a3277d31d9fa3fab7a6c1.tar.gz
Merge pull request #629 from RMJ10/missing-store-raw
Ensure raw tagnames are safe exiting internalEntityParser
-rw-r--r--expat/lib/xmlparse.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
index 7bcabf7f..d73f419c 100644
--- a/expat/lib/xmlparse.c
+++ b/expat/lib/xmlparse.c
@@ -5826,10 +5826,15 @@ internalEntityProcessor(XML_Parser parser, const char *s, const char *end,
{
parser->m_processor = contentProcessor;
/* see externalEntityContentProcessor vs contentProcessor */
- return doContent(parser, parser->m_parentParser ? 1 : 0, parser->m_encoding,
- s, end, nextPtr,
- (XML_Bool)! parser->m_parsingStatus.finalBuffer,
- XML_ACCOUNT_DIRECT);
+ result = doContent(parser, parser->m_parentParser ? 1 : 0,
+ parser->m_encoding, s, end, nextPtr,
+ (XML_Bool)! parser->m_parsingStatus.finalBuffer,
+ XML_ACCOUNT_DIRECT);
+ if (result == XML_ERROR_NONE) {
+ if (! storeRawNames(parser))
+ return XML_ERROR_NO_MEMORY;
+ }
+ return result;
}
}