Commit 9d3d141c authored by Daniel Veillard's avatar Daniel Veillard
Browse files

Fix a parsing problem with little data at startup

* parser.c: inkscape extension loader (and possibly others) feed
  data to the parser very slowly, 0 at start, 4 bytes on first GROW
  and this broke after the fix for
  leading to another bug
  this detects the situation and GROW when needed for proper processing.
parent e21731de
......@@ -10130,8 +10130,12 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
* Check for the XMLDecl in the Prolog.
* do not GROW here to avoid the detected encoder to decode more
* than just the first line
* than just the first line, unless the amount of data is really
* too small to hold "<?xml version="1.0" encoding="foo"
if ((ctxt->input->end - ctxt->input->cur) < 35) {
if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
Supports Markdown
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