diff options
author | Daniel Veillard <veillard@redhat.com> | 2015-11-20 15:06:02 +0800 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2015-11-20 15:06:02 +0800 |
commit | 3bd6ae147e294da6b378379cc87615b8fc111e73 (patch) | |
tree | 494c8fa13c6a7f91a632c49a6414ce6ad831e226 | |
parent | 35bcb1d758ed70aa7b257c9c3b3ff55e54e3d0da (diff) | |
download | android_external_libxml2-3bd6ae147e294da6b378379cc87615b8fc111e73.tar.gz android_external_libxml2-3bd6ae147e294da6b378379cc87615b8fc111e73.tar.bz2 android_external_libxml2-3bd6ae147e294da6b378379cc87615b8fc111e73.zip |
Fix some loop issues embedding NEXT
Next can switch the parser back to XML_PARSER_EOF state, we
need to consider those in loops consuming input
-rw-r--r-- | parser.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2160,7 +2160,8 @@ xmlSkipBlankChars(xmlParserCtxtPtr ctxt) { int cur; do { cur = CUR; - while (IS_BLANK_CH(cur)) { /* CHECKED tstblanks.xml */ + while ((IS_BLANK_CH(cur) && /* CHECKED tstblanks.xml */ + (ctxt->instate != XML_PARSER_EOF))) { NEXT; cur = CUR; res++; @@ -2174,7 +2175,8 @@ xmlSkipBlankChars(xmlParserCtxtPtr ctxt) { * Need to handle support of entities branching here */ if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt); - } while (IS_BLANK(cur)); /* CHECKED tstblanks.xml */ + } while ((IS_BLANK(cur)) && /* CHECKED tstblanks.xml */ + (ctxt->instate != XML_PARSER_EOF)); } return(res); } |