mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
Fixing two stupid bugs on entities and HTML tree deallocation, Daniel.
This commit is contained in:
18
entities.c
18
entities.c
@ -260,6 +260,15 @@ xmlGetParameterEntity(xmlDocPtr doc, const CHAR *name) {
|
||||
(!xmlStrcmp(cur->name, name))) return(cur);
|
||||
}
|
||||
}
|
||||
if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) {
|
||||
table = (xmlEntitiesTablePtr) doc->extSubset->entities;
|
||||
for (i = 0;i < table->nb_entities;i++) {
|
||||
cur = &table->table[i];
|
||||
if (((cur->type == XML_INTERNAL_PARAMETER_ENTITY) ||
|
||||
(cur->type == XML_EXTERNAL_PARAMETER_ENTITY)) &&
|
||||
(!xmlStrcmp(cur->name, name))) return(cur);
|
||||
}
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@ -317,6 +326,15 @@ xmlGetDocEntity(xmlDocPtr doc, const CHAR *name) {
|
||||
(!xmlStrcmp(cur->name, name))) return(cur);
|
||||
}
|
||||
}
|
||||
if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) {
|
||||
table = (xmlEntitiesTablePtr) doc->extSubset->entities;
|
||||
for (i = 0;i < table->nb_entities;i++) {
|
||||
cur = &table->table[i];
|
||||
if ((cur->type != XML_INTERNAL_PARAMETER_ENTITY) &&
|
||||
(cur->type != XML_EXTERNAL_PARAMETER_ENTITY) &&
|
||||
(!xmlStrcmp(cur->name, name))) return(cur);
|
||||
}
|
||||
}
|
||||
if (xmlPredefinedEntities == NULL)
|
||||
xmlInitializePredefinedEntities();
|
||||
table = xmlPredefinedEntities;
|
||||
|
Reference in New Issue
Block a user