From ab6639564c9a5a147aa3b2f67fcb37ac0d8c0b14 Mon Sep 17 00:00:00 2001 From: foobar Date: Fri, 12 Jan 2001 16:49:06 +0000 Subject: [PATCH] - Fixed a possible crash bug in xmltree(). # PR: #7052 --- ext/domxml/php_domxml.c | 6 ++++-- 1 file 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); -- 2.50.1