diff -Naurp php-5.5.9/ext/simplexml/simplexml.c php-5.5.9.oden/ext/simplexml/simplexml.c --- php-5.5.9/ext/simplexml/simplexml.c 2014-02-05 11:00:36.000000000 +0100 +++ php-5.5.9.oden/ext/simplexml/simplexml.c 2014-02-12 11:28:36.226857491 +0100 @@ -1660,6 +1660,13 @@ SXE_METHOD(addChild) 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); }