diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2009-03-25 09:43:49 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2009-03-25 09:43:49 +0000 |
commit | db3ce96906c09559d944c72b69eb984105f34776 (patch) | |
tree | db54fd310c7f460dc44f635c6c471e5f2f8f6ce9 /xpath.c | |
parent | 43bc89c1e31d2e4f0cdec2592b947393e967041d (diff) | |
download | libxml2-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |