mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
closed #73430, don't read from an input source which indicated an
* xmlIO.c: closed #73430, don't read from an input source which indicated an end-of-file or an error. Daniel
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Tue Mar 5 21:27:03 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* 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 <daniel@veillard.com>
|
Tue Mar 5 16:33:42 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* parser.c: make sure SAX endDocument is always called as
|
* parser.c: make sure SAX endDocument is always called as
|
||||||
|
15
xmlIO.c
15
xmlIO.c
@ -2080,6 +2080,19 @@ xmlParserInputBufferPush(xmlParserInputBufferPtr in,
|
|||||||
return(nbchars);
|
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:
|
* xmlParserInputBufferGrow:
|
||||||
* @in: a buffered parser input
|
* @in: a buffered parser input
|
||||||
@ -2125,6 +2138,8 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
|
|||||||
*/
|
*/
|
||||||
if (in->readcallback != NULL) {
|
if (in->readcallback != NULL) {
|
||||||
res = in->readcallback(in->context, &buffer[0], len);
|
res = in->readcallback(in->context, &buffer[0], len);
|
||||||
|
if (res <= 0)
|
||||||
|
in->readcallback = endOfInput;
|
||||||
} else {
|
} else {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"xmlParserInputBufferGrow : no input !\n");
|
"xmlParserInputBufferGrow : no input !\n");
|
||||||
|
Reference in New Issue
Block a user