xmlXPathRegisterNs should not allow enpty prefixes daniel

* xpath.c: xmlXPathRegisterNs should not allow enpty prefixes
daniel

svn path=/trunk/; revision=3821
diff --git a/ChangeLog b/ChangeLog
index 1c03942..7bc9d4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Mar 25 10:43:07 CET 2009 Daniel Veillard <daniel@veillard.com>
+
+	* xpath.c: xmlXPathRegisterNs should not allow enpty prefixes
+
 Mon Mar 23 20:27:15 CET 2009 Daniel Veillard <daniel@veillard.com>
 
 	* tree.c: add a missing check in xmlAddSibling, patch by Kris Breuker
diff --git a/xpath.c b/xpath.c
index 57442e6..7adc753 100644
--- a/xpath.c
+++ b/xpath.c
@@ -5003,7 +5003,7 @@
 /**
  * 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 @@
 	return(-1);
     if (prefix == NULL)
 	return(-1);
+    if (prefix[0] == 0)
+	return(-1);
 
     if (ctxt->nsHash == NULL)
 	ctxt->nsHash = xmlHashCreate(10);