mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
fix a nasty problem with reading over the end fix a reported memory leak
* xmlreader.c: fix a nasty problem with reading over the end * xmlsave.c: fix a reported memory leak apparently Daniel
This commit is contained in:
parent
9ea6231ece
commit
e2161a699b
@ -1,3 +1,8 @@
|
||||
Thu Apr 29 20:15:20 CEST 2004 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* xmlreader.c: fix a nasty problem with reading over the end
|
||||
* xmlsave.c: fix a reported memory leak apparently
|
||||
|
||||
Thu Apr 29 17:05:00 CEST 2004 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* win32/Makefile.msvc: patch from Mark Vakoc for regression tests
|
||||
|
@ -1179,6 +1179,8 @@ xmlTextReaderRead(xmlTextReaderPtr reader) {
|
||||
fprintf(stderr, "\nREAD ");
|
||||
DUMP_READER
|
||||
#endif
|
||||
if (reader->mode == XML_TEXTREADER_DONE)
|
||||
return(0);
|
||||
reader->curnode = NULL;
|
||||
if (reader->mode == XML_TEXTREADER_MODE_INITIAL) {
|
||||
reader->mode = XML_TEXTREADER_MODE_INTERACTIVE;
|
||||
@ -1215,12 +1217,15 @@ xmlTextReaderRead(xmlTextReaderPtr reader) {
|
||||
oldnode = reader->node;
|
||||
|
||||
get_next_node:
|
||||
if (reader->node == NULL)
|
||||
return(-1);
|
||||
|
||||
/*
|
||||
* If we are not backtracking on ancestors or examined nodes,
|
||||
* that the parser didn't finished or that we arent at the end
|
||||
* of stream, continue processing.
|
||||
*/
|
||||
while ((reader->node->next == NULL) &&
|
||||
while ((reader->node != NULL) && (reader->node->next == NULL) &&
|
||||
(reader->ctxt->nodeNr == olddepth) &&
|
||||
((oldstate == XML_TEXTREADER_BACKTRACK) ||
|
||||
(reader->node->children == NULL) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user