patch from Jack J Franklin to remove a bug in xmlCreatePushParserCtxt()
* parser.c: patch from Jack J Franklin to remove a bug in
xmlCreatePushParserCtxt() when the initial buffer passed
is large.
Daniel
diff --git a/parser.c b/parser.c
index 08d18ee..601430c 100644
--- a/parser.c
+++ b/parser.c
@@ -8783,7 +8783,15 @@
if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) &&
(ctxt->input->buf != NULL)) {
+ int base = ctxt->input->base - ctxt->input->buf->buffer->content;
+ int cur = ctxt->input->cur - ctxt->input->base;
+
xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
+
+ ctxt->input->base = ctxt->input->buf->buffer->content + base;
+ ctxt->input->cur = ctxt->input->base + cur;
+ ctxt->input->end =
+ &ctxt->input->buf->buffer->content[ctxt->input->buf->buffer->use];
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "PP: pushed %d\n", size);
#endif