1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

applied patch from Massimo Morara fixing bug #317447 about risk of invalid

* parser.c: applied patch from Massimo Morara fixing bug #317447
  about risk of invalid write in xmlStringLenDecodeEntities
Daniel
This commit is contained in:
Daniel Veillard
2005-09-28 21:42:15 +00:00
parent d070d3ca68
commit bedc9771e7
2 changed files with 11 additions and 0 deletions

View File

@@ -1,3 +1,8 @@
Wed Sep 28 23:42:14 CEST 2005 Daniel Veillard <daniel@veillard.com>
* parser.c: applied patch from Massimo Morara fixing bug #317447
about risk of invalid write in xmlStringLenDecodeEntities
Tue Sep 27 11:20:57 CEST 2005 Daniel Veillard <daniel@veillard.com>
* error.c: Adrian Mouat pointed out redundancies in xmlReportError()

View File

@@ -2177,6 +2177,9 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
if (val != 0) {
COPY_BUF(0,buffer,nbchars,val);
}
if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) {
growBuffer(buffer);
}
} else if ((c == '&') && (what & XML_SUBSTITUTE_REF)) {
if (xmlParserDebugEntities)
xmlGenericError(xmlGenericErrorContext,
@@ -2187,6 +2190,9 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
if (ent->content != NULL) {
COPY_BUF(0,buffer,nbchars,ent->content[0]);
if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) {
growBuffer(buffer);
}
} else {
xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
"predefined entity has no content\n");