diff options
author | kwaclaw <kwaclaw> | 2004-12-24 16:30:25 +0000 |
---|---|---|
committer | kwaclaw <kwaclaw> | 2004-12-24 16:30:25 +0000 |
commit | 244992251a6575b75c69452c0518b884d8e0c12d (patch) | |
tree | bd06a8efcec3269f1b9efe8dc7f7a36b6a453c28 /lib/xmlparse.c | |
parent | 84404526d443f12afb6b615f9114b7816bd991c6 (diff) | |
download | libexpat-244992251a6575b75c69452c0518b884d8e0c12d.tar.gz |
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.
Diffstat (limited to 'lib/xmlparse.c')
-rw-r--r-- | lib/xmlparse.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/xmlparse.c b/lib/xmlparse.c index e6badfb..163ee27 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c @@ -1441,7 +1441,7 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) /* 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 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) } XmlUpdatePosition(encoding, positionPtr, end, &position); - positionPtr = end; nLeftOver = s + len - end; if (nLeftOver) { if (buffer == NULL || nLeftOver > bufferLim - buffer) { @@ -1518,9 +1517,13 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) 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 */ |