1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

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
This commit is contained in:
Daniel Veillard
2002-01-06 12:47:22 +00:00
parent 0e47ee29be
commit aa39a0fb6b
2 changed files with 14 additions and 0 deletions

View File

@ -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