tony2001 Mon Feb 12 21:06:29 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/simplexml/tests bug40451.phpt
Modified files: /php-src/ext/simplexml simplexml.c Log: fix #40451 (addAttribute() may crash when used with non-existent child node) http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.20&r2=1.151.2.22.2.21&diff_format=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.20 php-src/ext/simplexml/simplexml.c:1.151.2.22.2.21 --- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.20 Mon Jan 1 09:36:06 2007 +++ php-src/ext/simplexml/simplexml.c Mon Feb 12 21:06:29 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simplexml.c,v 1.151.2.22.2.20 2007/01/01 09:36:06 sebastian Exp $ */ +/* $Id: simplexml.c,v 1.151.2.22.2.21 2007/02/12 21:06:29 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1526,7 +1526,7 @@ node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - if (node->type != XML_ELEMENT_NODE) { + if (node && node->type != XML_ELEMENT_NODE) { node = node->parent; } @@ -2342,7 +2342,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "Simplexml support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.20 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.21 $"); php_info_print_table_row(2, "Schema support", #ifdef LIBXML_SCHEMAS_ENABLED "enabled"); http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug40451.phpt?view=markup&rev=1.1 Index: php-src/ext/simplexml/tests/bug40451.phpt +++ php-src/ext/simplexml/tests/bug40451.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php