]> granicus.if.org Git - php/commitdiff
fix segfault when node is NULL
authorAntony Dovgal <tony2001@php.net>
Mon, 27 Dec 2010 21:47:52 +0000 (21:47 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 27 Dec 2010 21:47:52 +0000 (21:47 +0000)
ext/simplexml/simplexml.c

index d767b5bf89dd7321436d0fcf148899d56065cb19..51961472f78a18b2f8ccb579e247ca251056ba11 100644 (file)
@@ -1099,7 +1099,7 @@ static HashTable * sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{
                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;