[libxml2] move current position before possible calling of ctxt->sax->characters.



commit 46c658b025b10a0b4266a34c93adfaf4e3a57425
Author: Yulin Li <liyulin pku edu cn>
Date:   Fri Aug 6 08:48:24 2021 +0000

    move current position before possible calling of ctxt->sax->characters.

 parser.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/parser.c b/parser.c
index 0737b7f7..2f7ac112 100644
--- a/parser.c
+++ b/parser.c
@@ -4587,6 +4587,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;
 
@@ -4620,8 +4623,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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]