mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
Fix potential infinite loop in xmlStringLenDecodeEntities
Make sure that xmlParseStringPEReference advances the "str" pointer even if the parser was stopped. Otherwise xmlStringLenDecodeEntities can loop infinitely.
This commit is contained in:
1
parser.c
1
parser.c
@@ -8327,6 +8327,7 @@ xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
|
|||||||
entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
|
entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
|
||||||
if (ctxt->instate == XML_PARSER_EOF) {
|
if (ctxt->instate == XML_PARSER_EOF) {
|
||||||
xmlFree(name);
|
xmlFree(name);
|
||||||
|
*str = ptr;
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
if (entity == NULL) {
|
if (entity == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user