Check parsing is faulted once parser is FINISHED

This commit is contained in:
Rhodri James 2017-02-07 11:46:55 +00:00 committed by Sebastian Pipping
parent ce9b32fe94
commit d7550d1446

View file

@ -1714,6 +1714,12 @@ external_entity_resetter(XML_Parser parser,
fail("Parsing status is not FINISHED");
return XML_STATUS_ERROR;
}
/* Check we can't parse here */
if (XML_Parse(ext_parser, text, strlen(text),
XML_TRUE) != XML_STATUS_ERROR)
fail("Parsing when finished not faulted");
if (XML_GetErrorCode(ext_parser) != XML_ERROR_FINISHED)
fail("Parsing when finished faulted with wrong code");
XML_ParserReset(ext_parser, NULL);
XML_GetParsingStatus(ext_parser, &status);
if (status.parsing != XML_FINISHED) {