Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > c1bee5c9eb6eb19a1ab30e99bcbc5b91 > files > 14

php-5.4.13-3.mga3.src.rpm

diff -u -3 -p -r1.151.2.22.2.35 -r1.151.2.22.2.36
--- ext/simplexml/simplexml.c	31 Jul 2007 15:40:49 -0000	1.151.2.22.2.35
+++ ext/simplexml/simplexml.c	12 Nov 2007 18:59:26 -0000	1.151.2.22.2.36
@@ -1635,6 +1635,13 @@ SXE_METHOD(addAttribute)
 
 	localname = xmlSplitQName2((xmlChar *)qname, &prefix);
 	if (localname == NULL) {
+		if (nsuri_len > 0) {
+			if (prefix != NULL) {
+				xmlFree(prefix);
+			}
+			php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute requires prefix for namespace");
+			return;
+		}
 		localname = xmlStrdup((xmlChar *)qname);
 	}