libxml2 r3821 - trunk



Author: veillard
Date: Wed Mar 25 09:43:49 2009
New Revision: 3821
URL: http://svn.gnome.org/viewvc/libxml2?rev=3821&view=rev

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


Modified:
   trunk/ChangeLog
   trunk/xpath.c

Modified: trunk/xpath.c
==============================================================================
--- trunk/xpath.c	(original)
+++ trunk/xpath.c	Wed Mar 25 09:43:49 2009
@@ -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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]