]> granicus.if.org Git - php/commitdiff
- Fixed a possible crash bug in xmltree().
authorfoobar <sniper@php.net>
Fri, 12 Jan 2001 16:49:06 +0000 (16:49 +0000)
committerfoobar <sniper@php.net>
Fri, 12 Jan 2001 16:49:06 +0000 (16:49 +0000)
# PR: #7052

ext/domxml/php_domxml.c

index d58391ccd744c3091b0f29068263b4864c505faf..39ddab7675f233dd4ef46539118f1943c1e39d18 100644 (file)
@@ -1406,8 +1406,10 @@ static int node_children(zval **children, xmlNode *nodep)
                zend_hash_next_index_insert((*children)->value.ht, &child, sizeof(zval *), NULL);
 
                /* Add name, content and type as properties */
-               add_property_stringl(child, "name", (char *) last->name, strlen(last->name), 1);
-               add_property_long(child, "type", last->type);
+               if(last->name)
+                       add_property_stringl(child, "name", (char *) last->name, strlen(last->name), 1);
+               if(last->type)
+                       add_property_long(child, "type", last->type);
                content = xmlNodeGetContent(last);
                if(content)
                        add_property_stringl(child, "content", (char *) content, strlen(content), 1);