Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1083)

Unified Diff: Source/core/xml/parser/XMLDocumentParser.cpp

Issue 1316673007: Fix handling of large xml documents (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-big-document-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/parser/XMLDocumentParser.cpp
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp
index 816d9d396522efeb1f903498ca499d4103c1a624..72bb31ac61488b05d63b264702c889bc6581ce0a 100644
--- a/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -734,6 +734,7 @@ PassRefPtr<XMLParserContext> XMLParserContext::createStringParser(xmlSAXHandlerP
{
initializeLibXMLIfNecessary();
xmlParserCtxtPtr parser = xmlCreatePushParserCtxt(handlers, 0, 0, 0, 0);
+ xmlCtxtUseOptions(parser, XML_PARSE_HUGE);
parser->_private = userData;
parser->replaceEntities = true;
return adoptRef(new XMLParserContext(parser));
@@ -756,7 +757,8 @@ PassRefPtr<XMLParserContext> XMLParserContext::createMemoryParser(xmlSAXHandlerP
// Set parser options.
// XML_PARSE_NODICT: default dictionary option.
// XML_PARSE_NOENT: force entities substitutions.
- xmlCtxtUseOptions(parser, XML_PARSE_NODICT | XML_PARSE_NOENT);
+ // XML_PARSE_HUGE: don't impose arbitrary limits on document size.
+ xmlCtxtUseOptions(parser, XML_PARSE_NODICT | XML_PARSE_NOENT | XML_PARSE_HUGE);
// Internal initialization
parser->sax2 = 1;
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-big-document-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698