diff options
Diffstat (limited to 'chromium/third_party/libxml/src/parser.c')
-rw-r--r-- | chromium/third_party/libxml/src/parser.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/chromium/third_party/libxml/src/parser.c b/chromium/third_party/libxml/src/parser.c index 34e63d8024a..9eaf7d71b2c 100644 --- a/chromium/third_party/libxml/src/parser.c +++ b/chromium/third_party/libxml/src/parser.c @@ -2201,7 +2201,8 @@ xmlSkipBlankChars(xmlParserCtxtPtr ctxt) { * It's Okay to use CUR/NEXT here since all the blanks are on * the ASCII range. */ - if (ctxt->instate != XML_PARSER_DTD) { + if (((ctxt->inputNr == 1) && (ctxt->instate != XML_PARSER_DTD)) || + (ctxt->instate == XML_PARSER_START)) { const xmlChar *cur; /* * if we are in the document content, go really fast @@ -4594,6 +4595,9 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata) { } } COPY_BUF(l,buf,nbchar,cur); + /* move current position before possible calling of ctxt->sax->characters */ + NEXTL(l); + cur = CUR_CHAR(l); if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) { buf[nbchar] = 0; @@ -4627,8 +4631,6 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata) { if (ctxt->instate == XML_PARSER_EOF) return; } - NEXTL(l); - cur = CUR_CHAR(l); } if (nbchar != 0) { buf[nbchar] = 0; @@ -12643,6 +12645,7 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data, xmlFree(ctxt->sax); ctxt->sax = (xmlSAXHandlerPtr) xmlMalloc(sizeof(xmlSAXHandler)); if (ctxt->sax == NULL) { + xmlFreeParserInputBuffer(buf); xmlErrMemory(ctxt, NULL); xmlFreeParserCtxt(ctxt); return(NULL); |