From: Marcus Boerger Date: Mon, 10 Apr 2006 23:23:09 +0000 (+0000) Subject: - Coverity issue 59 X-Git-Tag: php-5.1.3RC3~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45b64e7a9903d7d110a97ed50b3350483f45d5a8;p=php - Coverity issue 59 --- diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 69cc4a6b58..99d16d7790 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -2107,6 +2107,9 @@ static int php_sxe_iterator_current_key(zend_object_iterator *iter, char **str_k if (intern != NULL && intern->node != NULL) { curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->node)->node; } + if (!curnode) { + return HASH_KEY_NON_EXISTANT; + } namelen = xmlStrlen(curnode->name); *str_key = estrndup(curnode->name, namelen);