[Expat-checkins] expat/lib xmlparse.c,1.140,1.141

Karl Waclawek kwaclaw at users.sourceforge.net
Fri Dec 24 17:30:35 CET 2004


Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32236

Modified Files:
	xmlparse.c 
Log Message:
Fix for bug # 1090885: Problem with Suspend/Resume mechanism.
The code path through XML_Parse() when XML_CONTEXT_BYTES
was not defined, did not take into account that XML_ResumParser()
uses bufferPtr and parseEndPtr as the pointers into the working buffer.

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- xmlparse.c	21 Dec 2004 18:30:52 -0000	1.140
+++ xmlparse.c	24 Dec 2004 16:30:25 -0000	1.141
@@ -1441,7 +1441,7 @@
 
     /* If data are left over from last buffer, and we now know that these
        data are the final chunk of input, then we have to check them again
-       to detect errors based on this information.
+       to detect errors based on that fact.
     */
     errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr);
 
@@ -1495,7 +1495,6 @@
     }
 
     XmlUpdatePosition(encoding, positionPtr, end, &position);
-    positionPtr = end;
     nLeftOver = s + len - end;
     if (nLeftOver) {
       if (buffer == NULL || nLeftOver > bufferLim - buffer) {
@@ -1518,9 +1517,13 @@
         bufferLim = buffer + len * 2;
       }
       memcpy(buffer, end, nLeftOver);
-      bufferPtr = buffer;
-      bufferEnd = buffer + nLeftOver;
     }
+    bufferPtr = buffer;
+    bufferEnd = buffer + nLeftOver;
+    positionPtr = bufferPtr;
+    parseEndPtr = bufferEnd;
+    eventPtr = bufferPtr;
+    eventEndPtr = bufferPtr;
     return result;
   }
 #endif  /* not defined XML_CONTEXT_BYTES */



More information about the Expat-checkins mailing list