tony2001                                 Mon, 27 Dec 2010 21:47:52 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=306765

Log:
fix segfault when node is NULL

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/simplexml/simplexml.c
    U   php/php-src/trunk/ext/simplexml/simplexml.c

Modified: php/php-src/branches/PHP_5_3/ext/simplexml/simplexml.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/simplexml/simplexml.c      2010-12-27 
21:42:05 UTC (rev 306764)
+++ php/php-src/branches/PHP_5_3/ext/simplexml/simplexml.c      2010-12-27 
21:47:52 UTC (rev 306765)
@@ -1099,7 +1099,7 @@
                if (sxe->iter.type == SXE_ITER_ELEMENT) {
                        node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
                }
-               if (node->type != XML_ENTITY_DECL) {
+               if (!node || node->type != XML_ENTITY_DECL) {
                        attr = node ? (xmlAttrPtr)node->properties : NULL;
                        zattr = NULL;
                        test = sxe->iter.name && sxe->iter.type == 
SXE_ITER_ATTRLIST;

Modified: php/php-src/trunk/ext/simplexml/simplexml.c
===================================================================
--- php/php-src/trunk/ext/simplexml/simplexml.c 2010-12-27 21:42:05 UTC (rev 
306764)
+++ php/php-src/trunk/ext/simplexml/simplexml.c 2010-12-27 21:47:52 UTC (rev 
306765)
@@ -1099,7 +1099,7 @@
                if (sxe->iter.type == SXE_ITER_ELEMENT) {
                        node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
                }
-               if (node->type != XML_ENTITY_DECL) {
+               if (!node || node->type != XML_ENTITY_DECL) {
                        attr = node ? (xmlAttrPtr)node->properties : NULL;
                        zattr = NULL;
                        test = sxe->iter.name && sxe->iter.type == 
SXE_ITER_ATTRLIST;

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

Reply via email to