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:
@@ -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>
|
Tue Sep 27 11:20:57 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* error.c: Adrian Mouat pointed out redundancies in xmlReportError()
|
* error.c: Adrian Mouat pointed out redundancies in xmlReportError()
|
||||||
|
6
parser.c
6
parser.c
@@ -2177,6 +2177,9 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
|
|||||||
if (val != 0) {
|
if (val != 0) {
|
||||||
COPY_BUF(0,buffer,nbchars,val);
|
COPY_BUF(0,buffer,nbchars,val);
|
||||||
}
|
}
|
||||||
|
if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) {
|
||||||
|
growBuffer(buffer);
|
||||||
|
}
|
||||||
} else if ((c == '&') && (what & XML_SUBSTITUTE_REF)) {
|
} else if ((c == '&') && (what & XML_SUBSTITUTE_REF)) {
|
||||||
if (xmlParserDebugEntities)
|
if (xmlParserDebugEntities)
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@@ -2187,6 +2190,9 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
|
|||||||
(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
|
(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
|
||||||
if (ent->content != NULL) {
|
if (ent->content != NULL) {
|
||||||
COPY_BUF(0,buffer,nbchars,ent->content[0]);
|
COPY_BUF(0,buffer,nbchars,ent->content[0]);
|
||||||
|
if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) {
|
||||||
|
growBuffer(buffer);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
|
xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
|
||||||
"predefined entity has no content\n");
|
"predefined entity has no content\n");
|
||||||
|
Reference in New Issue
Block a user