mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-25 23:21:26 +03:00
fixed bug #383687, some case of recursion on next were not caught in the
* catalog.c: fixed bug #383687, some case of recursion on next were not caught in the catalog code. Daniel svn path=/trunk/; revision=3628
This commit is contained in:
parent
861101d1fa
commit
be8d9d33eb
@ -1,3 +1,8 @@
|
||||
Tue Jun 12 11:12:50 CEST 2007 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* catalog.c: fixed bug #383687, some case of recursion on next
|
||||
were not caught in the catalog code.
|
||||
|
||||
Tue Jun 12 10:37:42 CEST 2007 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* HTMLparser.c: fixed bug #381877, avoid reading over the end
|
||||
|
23
catalog.c
23
catalog.c
@ -1828,6 +1828,8 @@ xmlCatalogXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID,
|
||||
if (ret != NULL) {
|
||||
catal->depth--;
|
||||
return(ret);
|
||||
} else if (catal->depth > MAX_CATAL_DEPTH) {
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1868,6 +1870,13 @@ xmlCatalogXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) {
|
||||
if (URI == NULL)
|
||||
return(NULL);
|
||||
|
||||
if (catal->depth > MAX_CATAL_DEPTH) {
|
||||
xmlCatalogErr(catal, NULL, XML_CATALOG_RECURSION,
|
||||
"Detected recursion in catalog %s\n",
|
||||
catal->name, NULL, NULL);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* First tries steps 2/ 3/ 4/ if a system ID is provided.
|
||||
*/
|
||||
@ -2053,16 +2062,18 @@ xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID,
|
||||
if (catal->children != NULL) {
|
||||
ret = xmlCatalogXMLResolve(catal->children, pubID, sysID);
|
||||
if (ret != NULL) {
|
||||
if (normid != NULL)
|
||||
xmlFree(normid);
|
||||
return(ret);
|
||||
}
|
||||
break;
|
||||
} else if ((catal->children != NULL) &&
|
||||
(catal->children->depth > MAX_CATAL_DEPTH)) {
|
||||
ret = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catal = catal->next;
|
||||
}
|
||||
if (normid != NULL)
|
||||
xmlFree(normid);
|
||||
if (normid != NULL)
|
||||
xmlFree(normid);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user