summaryrefslogtreecommitdiff
path: root/xpath.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2009-03-25 09:43:49 +0000
committerDaniel Veillard <veillard@src.gnome.org>2009-03-25 09:43:49 +0000
commitdb3ce96906c09559d944c72b69eb984105f34776 (patch)
treedb54fd310c7f460dc44f635c6c471e5f2f8f6ce9 /xpath.c
parent43bc89c1e31d2e4f0cdec2592b947393e967041d (diff)
downloadlibxml2-db3ce96906c09559d944c72b69eb984105f34776.tar.gz
xmlXPathRegisterNs should not allow enpty prefixes daniel
* xpath.c: xmlXPathRegisterNs should not allow enpty prefixes daniel svn path=/trunk/; revision=3821
Diffstat (limited to 'xpath.c')
-rw-r--r--xpath.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xpath.c b/xpath.c
index 57442e6a..7adc7533 100644
--- a/xpath.c
+++ b/xpath.c
@@ -5003,7 +5003,7 @@ xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt) {
/**
* xmlXPathRegisterNs:
* @ctxt: the XPath context
- * @prefix: the namespace prefix
+ * @prefix: the namespace prefix cannot be NULL or empty string
* @ns_uri: the namespace name
*
* Register a new namespace. If @ns_uri is NULL it unregisters
@@ -5018,6 +5018,8 @@ xmlXPathRegisterNs(xmlXPathContextPtr ctxt, const xmlChar *prefix,
return(-1);
if (prefix == NULL)
return(-1);
+ if (prefix[0] == 0)
+ return(-1);
if (ctxt->nsHash == NULL)
ctxt->nsHash = xmlHashCreate(10);