Commit 9b851233 authored by Daniel Veillard's avatar Daniel Veillard

Cleanup conditional section error handling

For https://bugzilla.gnome.org/show_bug.cgi?id=744980

The error handling of Conditional Section also need to be
straightened as the structure of the document can't be
guessed on a failure there and it's better to stop parsing
as further errors are likely to be irrelevant.
parent a7dfab74
...@@ -6770,6 +6770,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) { ...@@ -6770,6 +6770,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
SKIP_BLANKS; SKIP_BLANKS;
if (RAW != '[') { if (RAW != '[') {
xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL); xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
xmlStopParser(ctxt);
return;
} else { } else {
if (ctxt->input->id != id) { if (ctxt->input->id != id) {
xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY, xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
...@@ -6830,6 +6832,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) { ...@@ -6830,6 +6832,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
SKIP_BLANKS; SKIP_BLANKS;
if (RAW != '[') { if (RAW != '[') {
xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL); xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
xmlStopParser(ctxt);
return;
} else { } else {
if (ctxt->input->id != id) { if (ctxt->input->id != id) {
xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY, xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
...@@ -6885,6 +6889,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) { ...@@ -6885,6 +6889,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
} else { } else {
xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL); xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL);
xmlStopParser(ctxt);
return;
} }
if (RAW == 0) if (RAW == 0)
......
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