diff --git a/buf.c b/buf.c index e0afd798..266395f4 100644 --- a/buf.c +++ b/buf.c @@ -1017,8 +1017,12 @@ xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer) { */ int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input) { - if ((input == NULL) || (buf == NULL) || (buf->error)) + if (input == NULL) return(-1); + if ((buf == NULL) || (buf->error)) { + input->base = input->cur = input->end = BAD_CAST ""; + return(-1); + } CHECK_COMPAT(buf) input->base = input->cur = buf->content; input->end = &buf->content[buf->use];