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.
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
index e6badfb..163ee27 100644
--- a/expat/lib/xmlparse.c
+++ b/expat/lib/xmlparse.c
@@ -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 */