summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 08:47:51 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 08:47:51 +0000
commit190941d4859b81bb91503826906086fe5f29ef59 (patch)
treed101ad50b59068150b0ea21ba7d66df2649b2bfa
parent22516e1af73b96db98a7e92e637db4cd21108c59 (diff)
downloadchromium_src-190941d4859b81bb91503826906086fe5f29ef59.zip
chromium_src-190941d4859b81bb91503826906086fe5f29ef59.tar.gz
chromium_src-190941d4859b81bb91503826906086fe5f29ef59.tar.bz2
Revert 100883 - Desist libxml from continuing the parse after a SAX callback has stopped the
parse. BUG=95465 TEST=covered by existing tests under ASAN Review URL: http://codereview.chromium.org/7875008 TBR=cevans@chromium.org Review URL: http://codereview.chromium.org/7886003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100884 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--third_party/libxml/README.chromium3
-rw-r--r--third_party/libxml/src/parser.c14
2 files changed, 4 insertions, 13 deletions
diff --git a/third_party/libxml/README.chromium b/third_party/libxml/README.chromium
index 83e4a2c..970b287 100644
--- a/third_party/libxml/README.chromium
+++ b/third_party/libxml/README.chromium
@@ -16,9 +16,8 @@ Modifications:
- Import follow-on for above commit: http://git.gnome.org/browse/libxml2/commit/?id=ea90b894146030c214a7df6d8375310174f134b9
- Import additional XPath fix http://git.gnome.org/browse/libxml2/commit/?id=df83c17e5a2646bd923f75e5e507bc80d73c9722
- Import follow-on fix for above commit: http://git.gnome.org/browse/libxml2/commit/?id=fec31bcd452e77c10579467ca87a785b41115de6
-- And a follow-on fix to the previous two fixes, committed upstream: http://git.gnome.org/browse/libxml2/commit/?id=f5048b3e71fc30ad096970b8df6e7af073bae4cb (slightly differently, but we can drop our local fix on the next roll).
+- And a follow-on fix to the previous two fixes, commit upstream is pending.
- Add a fix for handling of unknown namespaces, commit upstream is pending.
-- Add fixes for ending the parse properly if a SAX callback calls xmlStopParser(), commit upstream is pending.
To import a new snapshot of libxml:
diff --git a/third_party/libxml/src/parser.c b/third_party/libxml/src/parser.c
index a82fcd1..3ba2a06 100644
--- a/third_party/libxml/src/parser.c
+++ b/third_party/libxml/src/parser.c
@@ -4827,8 +4827,7 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
(ctxt->sax->processingInstruction != NULL))
ctxt->sax->processingInstruction(ctxt->userData,
target, NULL);
- if (ctxt->instate != XML_PARSER_EOF)
- ctxt->instate = state;
+ ctxt->instate = state;
return;
}
buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar));
@@ -4908,8 +4907,7 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
} else {
xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL);
}
- if (ctxt->instate != XML_PARSER_EOF)
- ctxt->instate = state;
+ ctxt->instate = state;
}
}
@@ -9468,8 +9466,6 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
else
name = xmlParseStartTag(ctxt);
#endif /* LIBXML_SAX1_ENABLED */
- if (ctxt->instate == XML_PARSER_EOF)
- return;
if (name == NULL) {
spacePop(ctxt);
return;
@@ -10849,8 +10845,6 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
else
name = xmlParseStartTag(ctxt);
#endif /* LIBXML_SAX1_ENABLED */
- if (ctxt->instate == XML_PARSER_EOF)
- return;
if (name == NULL) {
spacePop(ctxt);
ctxt->instate = XML_PARSER_EOF;
@@ -11037,9 +11031,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
else
xmlParseEndTag1(ctxt, 0);
#endif /* LIBXML_SAX1_ENABLED */
- if (ctxt->instate == XML_PARSER_EOF) {
- /* Nothing */
- } else if (ctxt->nameNr == 0) {
+ if (ctxt->nameNr == 0) {
ctxt->instate = XML_PARSER_EPILOG;
} else {
ctxt->instate = XML_PARSER_CONTENT;