From aa39a0fb6b80889fae02312dc879ea613d529658 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Sun, 6 Jan 2002 12:47:22 +0000 Subject: [PATCH] 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 --- ChangeLog | 6 ++++++ parser.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 416135fe..be41d33e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Jan 6 13:45:49 CET 2002 Daniel Veillard + + * parser.c: patch from Jack J Franklin to remove a bug in + xmlCreatePushParserCtxt() when the initial buffer passed + is large. + Sat Jan 5 19:24:23 CET 2002 Daniel Veillard * win32/*: big cleanup of the Windows/MSVC project files diff --git a/parser.c b/parser.c index 08d18ee0..601430cb 100644 --- a/parser.c +++ b/parser.c @@ -8783,7 +8783,15 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, 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