diff options
author | foobar <sniper@php.net> | 2001-01-12 16:49:06 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2001-01-12 16:49:06 +0000 |
commit | ab6639564c9a5a147aa3b2f67fcb37ac0d8c0b14 (patch) | |
tree | 5affa0293f10bcdc0712f345f1460a5c9853926a /ext/domxml/php_domxml.c | |
parent | 5faaf2436f80a33588be7b5757a753e876183521 (diff) | |
download | php-git-ab6639564c9a5a147aa3b2f67fcb37ac0d8c0b14.tar.gz |
- Fixed a possible crash bug in xmltree().
# PR: #7052
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index d58391ccd7..39ddab7675 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -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); |