mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
fixing #151456, an encoding error could generate a serialization loop.
* xmlIO.c: fixing #151456, an encoding error could generate a serialization loop. Daniel
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
Tue Aug 31 14:14:30 CEST 2004 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* xmlIO.c: fixing #151456, an encoding error could generate
|
||||
a serialization loop.
|
||||
|
||||
Tue Aug 31 11:34:04 CEST 2004 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* Makefile.am: also produce a tar ball with just the sources
|
||||
|
5
xmlIO.c
5
xmlIO.c
@ -3024,6 +3024,7 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
|
||||
int nbchars = 0; /* number of chars to output to I/O */
|
||||
int ret; /* return from function call */
|
||||
int written = 0; /* number of char written to I/O so far */
|
||||
int oldwritten=0;/* loop guard */
|
||||
int chunk; /* number of byte currently processed from str */
|
||||
int len; /* number of bytes in str */
|
||||
int cons; /* byte from str consumed */
|
||||
@ -3035,6 +3036,8 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
|
||||
if (escaping == NULL) escaping = xmlEscapeContent;
|
||||
|
||||
do {
|
||||
oldwritten = written;
|
||||
|
||||
/*
|
||||
* how many bytes to consume and how many bytes to store.
|
||||
*/
|
||||
@ -3111,7 +3114,7 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
|
||||
xmlBufferResize(out->buffer, out->buffer->size + MINLEN);
|
||||
}
|
||||
written += nbchars;
|
||||
} while (len > 0);
|
||||
} while ((len > 0) && (oldwritten != written));
|
||||
|
||||
done:
|
||||
#ifdef DEBUG_INPUT
|
||||
|
Reference in New Issue
Block a user