| Index: third_party/libxml/src/parser.c |
| =================================================================== |
| --- third_party/libxml/src/parser.c (revision 100884) |
| +++ third_party/libxml/src/parser.c (working copy) |
| @@ -4827,7 +4827,8 @@ |
| (ctxt->sax->processingInstruction != NULL)) |
| ctxt->sax->processingInstruction(ctxt->userData, |
| target, NULL); |
| - ctxt->instate = state; |
| + if (ctxt->instate != XML_PARSER_EOF) |
| + ctxt->instate = state; |
| return; |
| } |
| buf = (xmlChar *) xmlMallocAtomic(size * sizeof(xmlChar)); |
| @@ -4907,7 +4908,8 @@ |
| } else { |
| xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL); |
| } |
| - ctxt->instate = state; |
| + if (ctxt->instate != XML_PARSER_EOF) |
| + ctxt->instate = state; |
| } |
| } |
| |
| @@ -9466,6 +9468,8 @@ |
| else |
| name = xmlParseStartTag(ctxt); |
| #endif /* LIBXML_SAX1_ENABLED */ |
| + if (ctxt->instate == XML_PARSER_EOF) |
| + return; |
| if (name == NULL) { |
| spacePop(ctxt); |
| return; |
| @@ -10845,6 +10849,8 @@ |
| else |
| name = xmlParseStartTag(ctxt); |
| #endif /* LIBXML_SAX1_ENABLED */ |
| + if (ctxt->instate == XML_PARSER_EOF) |
| + goto done; |
| if (name == NULL) { |
| spacePop(ctxt); |
| ctxt->instate = XML_PARSER_EOF; |
| @@ -11031,7 +11037,9 @@ |
| else |
| xmlParseEndTag1(ctxt, 0); |
| #endif /* LIBXML_SAX1_ENABLED */ |
| - if (ctxt->nameNr == 0) { |
| + if (ctxt->instate == XML_PARSER_EOF) { |
| + /* Nothing */ |
| + } else if (ctxt->nameNr == 0) { |
| ctxt->instate = XML_PARSER_EPILOG; |
| } else { |
| ctxt->instate = XML_PARSER_CONTENT; |