diff --git a/ChangeLog b/ChangeLog index e0974f2d..ae2b1348 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Mar 5 21:27:03 CET 2002 Daniel Veillard + + * xmlIO.c: closed #73430, don't read from an input source + which indicated an end-of-file or an error. + Tue Mar 5 16:33:42 CET 2002 Daniel Veillard * parser.c: make sure SAX endDocument is always called as diff --git a/xmlIO.c b/xmlIO.c index 056beb88..edb2389a 100644 --- a/xmlIO.c +++ b/xmlIO.c @@ -2080,6 +2080,19 @@ xmlParserInputBufferPush(xmlParserInputBufferPtr in, return(nbchars); } +/** + * endOfInput: + * + * When reading from an Input channel indicated end of file or error + * don't reread from it again. + */ +static int +endOfInput (void * context ATTRIBUTE_UNUSED, + char * buffer ATTRIBUTE_UNUSED, + int len ATTRIBUTE_UNUSED) { + return(0); +} + /** * xmlParserInputBufferGrow: * @in: a buffered parser input @@ -2125,6 +2138,8 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) { */ if (in->readcallback != NULL) { res = in->readcallback(in->context, &buffer[0], len); + if (res <= 0) + in->readcallback = endOfInput; } else { xmlGenericError(xmlGenericErrorContext, "xmlParserInputBufferGrow : no input !\n");