From 3f5b1cfa75fc0f12432cdfeafd4fce1eea38a81f Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Sun, 29 Jul 2018 20:17:27 +0100 Subject: [PATCH] Fix for #204, XML_ResumeParser regression When we suspend at the end of input, we failed to update the parser's m_processor field to point to the epilogProcessor. When the regular contentProcessor runs with no input, it returns an error (which is what you usually want). If we had not suspended, in those circumstances we would have run the epilogProcessor instead, so we just make sure this is the processor we will invoke when we resume parsing. --- expat/lib/xmlparse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 435ee022..c3cd3859 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -3107,6 +3107,9 @@ doContent(XML_Parser parser, switch (parser->m_parsingStatus.parsing) { case XML_SUSPENDED: *nextPtr = next; + if (end == next) { + parser->m_processor = epilogProcessor; + } return XML_ERROR_NONE; case XML_FINISHED: return XML_ERROR_ABORTED; -- 2.40.0