From 89a9c6807c982b4fa8aa806dd72771d6642dd8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20Eren=20=C3=9Cr=C3=BCn?= Date: Wed, 19 Mar 2025 02:20:49 +0100 Subject: [PATCH] Stop updating m_eventPtr on exit for reentry The fix for recursive entity processing introduced a reenter flag that returns the execution from the current function and switches to entity processing. The same fix also updates the m_eventPtr during this switch. However this update changes the behaviour in certain cases as the older version does not update the m_eventPtr while recursing into entity processing. This commit removes the pointer update and restores the old behaviour. Reference: https://github.com/libexpat/libexpat/pull/989/commits/89a9c6807c982b4fa8aa806dd72771d6642dd8a1 Conflict: NA --- lib/xmlparse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/xmlparse.c b/lib/xmlparse.c index 626f56af..67bd3a54 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c @@ -3402,12 +3402,13 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, break; /* LCOV_EXCL_STOP */ } - *eventPP = s = next; switch (parser->m_parsingStatus.parsing) { case XML_SUSPENDED: + *eventPP = next; *nextPtr = next; return XML_ERROR_NONE; case XML_FINISHED: + *eventPP = next; return XML_ERROR_ABORTED; case XML_PARSING: if (parser->m_reenter) { @@ -3416,6 +3417,7 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, } /* Fall through */ default:; + *eventPP = s = next; } } /* not reached */ -- 2.37.3