Commit 24246c76 authored by Nick Wellnhofer's avatar Nick Wellnhofer
Browse files

Fix xmlHaltParser

Pop all extra input streams before resetting the input. Otherwise,
a call to xmlPopInput could make input available again.

Also set input->end to input->cur.

Changes the test output for some error tests. Unfortunately, some
fuzzed test cases were added to the test suite without manual cleanup.
This makes it almost impossible to review the impact of later changes
on the test output.
parent e5107772
......@@ -12590,6 +12590,8 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
return;
ctxt->instate = XML_PARSER_EOF;
ctxt->disableSAX = 1;
while (ctxt->inputNr > 1)
xmlFreeInputStream(inputPop(ctxt));
if (ctxt->input != NULL) {
/*
* in case there was a specific allocation deallocate before
......@@ -12601,6 +12603,7 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
}
ctxt->input->cur = BAD_CAST"";
ctxt->input->base = ctxt->input->cur;
ctxt->input->end = ctxt->input->cur;
}
}
......
......@@ -48,11 +48,11 @@ Entity: line 3:
^
./test/errors/759573-2.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
%xx;ggKENSMYNT#MENTD&#372zz;'>
^
^
./test/errors/759573-2.xml:6: parser error : DOCTYPE improperly terminated
%xx;ggKENSMYNT#MENTD&#372zz;'>
^
^
./test/errors/759573-2.xml:6: parser error : Start tag expected, '<' not found
%xx;ggKENSMYNT&#35;MENTD&#372zz;'>
^
^
......@@ -21,11 +21,14 @@ Entity: line 1:
^
./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
T t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITYz>%xx;
<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
^
./test/errors/759573.xml:1: parser error : DOCTYPE improperly terminated
T t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITYz>%xx;
<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
^
./test/errors/759573.xml:1: parser error : Start tag expected, '<' not found
T t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITYz>%xx;
./test/errors/759573.xml:1: parser error : StartTag: invalid element name
<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
^
./test/errors/759573.xml:1: parser error : Extra content at the end of the document
<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
^
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment