summaryrefslogtreecommitdiff
path: root/entities.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-01-24 15:02:46 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-01-24 15:02:46 +0000
commit3606581dcd45fbabfa95ce3565918d0c7e407633 (patch)
tree55e7cb4667c549acb1f6c35102610382c19fd2a5 /entities.c
parent5173727616a7e9ef8e6a2d3c256685413593b1bc (diff)
downloadlibxml2-3606581dcd45fbabfa95ce3565918d0c7e407633.tar.gz
another set of patches from Anthony Jones for copy operations cleanup and
* valid.c tree.c entities.c: another set of patches from Anthony Jones for copy operations cleanup and robustness Daniel
Diffstat (limited to 'entities.c')
-rw-r--r--entities.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/entities.c b/entities.c
index b2cb3d46..9d5937a7 100644
--- a/entities.c
+++ b/entities.c
@@ -323,6 +323,8 @@ xmlGetParameterEntity(xmlDocPtr doc, const xmlChar *name) {
xmlEntitiesTablePtr table;
xmlEntityPtr ret;
+ if (doc == NULL)
+ return(NULL);
if ((doc->intSubset != NULL) && (doc->intSubset->pentities != NULL)) {
table = (xmlEntitiesTablePtr) doc->intSubset->pentities;
ret = xmlGetEntityFromTable(table, name);
@@ -343,6 +345,7 @@ xmlGetParameterEntity(xmlDocPtr doc, const xmlChar *name) {
*
* Do an entity lookup in the DTD entity hash table and
* returns the corresponding entity, if found.
+ * Note: the first argument is the document node, not the DTD node.
*
* Returns A pointer to the entity structure or NULL if not found.
*/
@@ -350,6 +353,8 @@ xmlEntityPtr
xmlGetDtdEntity(xmlDocPtr doc, const xmlChar *name) {
xmlEntitiesTablePtr table;
+ if (doc == NULL)
+ return(NULL);
if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) {
table = (xmlEntitiesTablePtr) doc->extSubset->entities;
return(xmlGetEntityFromTable(table, name));