1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-25 23:21:26 +03:00

added a check within xmlOutputBufferWriteEscape to prevent a dead loop on

* xmlIO.c: added a check within xmlOutputBufferWriteEscape to prevent
  a dead loop on bad data (bug 159550)
This commit is contained in:
William M. Brack 2004-11-26 15:45:19 +00:00
parent 5dd55d950a
commit 66e40b14d5
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Fri Nov 26 23:20:48 HKT 2004 William Brack <wbrack@mmm.com.hk>
* xmlIO.c: added a check within xmlOutputBufferWriteEscape to prevent
a dead loop on bad data (bug 159550)
Fri Nov 26 13:09:04 CET 2004 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemas.c: Fixed strict/lax element wildcards: the children

View File

@ -3084,7 +3084,7 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
}
ret = escaping(out->buffer->content + out->buffer->use ,
&chunk, str, &cons);
if (ret < 0)
if ((ret < 0) || (chunk == 0)) /* chunk==0 => nothing done */
return(-1);
out->buffer->use += chunk;
out->buffer->content[out->buffer->use] = 0;
@ -3105,7 +3105,7 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
} else {
ret = escaping(out->buffer->content + out->buffer->use ,
&chunk, str, &cons);
if (ret < 0)
if ((ret < 0) || (chunk == 0)) /* chunk==0 => nothing done */
return(-1);
out->buffer->use += chunk;
out->buffer->content[out->buffer->use] = 0;