Can you revert this? Working on a fix, but need to apply it in a few more places, but taking a bit as I had a computer meltdown.
First time I ever saw an error message saying things are screwed, please reinstall operating system :)


By not freeing that node there it would leak and this special attribute cant be unlinked there either.
Problem stems from the fact that attribute default values come from DTD so are not "real" attribute nodes. These should never be unlinked or freed since they are really virtual nodes - at least thats how they are handled within libxml.
The node returned from xmlHasProp and xmlHasNsProp needs to have its type tested against XML_ATTRIBUTE_DECL.
If it's this type leave node alone. Fix will need to be made against to the following:
removeAttribute, setAttributeNode, removeAttributeNode, removeAttributeNS, setAttributeNS


Rob

Ilia Alshanetsky wrote:

iliaa           Thu May 19 09:47:22 2005 EDT

Modified files: /php-src/ext/dom element.c Log:
Fixed bug #33059 (crash when moving xml attribute set in dtd).
http://cvs.php.net/diff.php/php-src/ext/dom/element.c?r1=1.32&r2=1.33&ty=u
Index: php-src/ext/dom/element.c
diff -u php-src/ext/dom/element.c:1.32 php-src/ext/dom/element.c:1.33
--- php-src/ext/dom/element.c:1.32 Thu Nov 18 14:54:30 2004
+++ php-src/ext/dom/element.c Thu May 19 09:47:21 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/


-/* $Id: element.c,v 1.32 2004/11/18 19:54:30 rrichards Exp $ */
+/* $Id: element.c,v 1.33 2005/05/19 13:47:21 iliaa Exp $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -298,7 +298,6 @@
        if (php_dom_object_get_data((xmlNodePtr) attrp) == NULL) {
                node_list_unlink(attrp->children TSRMLS_CC);
                xmlUnlinkNode((xmlNodePtr) attrp);
-               xmlFreeProp(attrp);
        } else {
                xmlUnlinkNode((xmlNodePtr) attrp);
        }




-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to