@@ -234,7 +234,15 @@ Bool CXMLDocument::Read(char *data, unsigned long tlength, Bool wellformed)
234234{
235235 xmlKeepBlanksDefault (0 );
236236 Free (); // free document
237- doc = xmlSAXParseMemory (&SAXHandlerTable, data, tlength, !wellformed);
237+
238+ // MW-2014-03-10: [[ Bug 11903 ]] Use modified libXML functions that allow us to
239+ // pass through XML_PARSE_HUGE (so the new 2.9 limits don't apply!).
240+ int options;
241+ options = XML_PARSE_HUGE ;
242+ if (!wellformed)
243+ options |= XML_PARSE_RECOVER ;
244+
245+ doc = xmlSAXParseMemoryWithDataAndOptions (&SAXHandlerTable, data, tlength, options, NULL );
238246
239247 // OK-2007-12-17 : Bug 5632. If Validate() is called in this context it crashes
240248 // For now we just remove the validation step from here as it proved difficult to
@@ -250,7 +258,15 @@ Bool CXMLDocument::ReadFile(char *filename, Bool wellformed)
250258{
251259 xmlKeepBlanksDefault (0 );
252260 Free (); // free document
253- doc = xmlSAXParseFile (&SAXHandlerTable, filename, !wellformed);
261+
262+ // MW-2014-03-10: [[ Bug 11903 ]] Use modified libXML functions that allow us to
263+ // pass through XML_PARSE_HUGE (so the new 2.9 limits don't apply!).
264+ int options;
265+ options = XML_PARSE_HUGE ;
266+ if (!wellformed)
267+ options |= XML_PARSE_RECOVER ;
268+
269+ doc = xmlSAXParseFileWithDataAndOptions (&SAXHandlerTable, filename, options, NULL );
254270
255271 // OK-2007-12-17 : Bug 5632. If Validate() is called in this context it crashes
256272 // For now we just remove the validation step from here as it proved difficult to
0 commit comments