]> granicus.if.org Git - php/commitdiff
- Coverity issue 59
authorMarcus Boerger <helly@php.net>
Mon, 10 Apr 2006 23:23:09 +0000 (23:23 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 10 Apr 2006 23:23:09 +0000 (23:23 +0000)
ext/simplexml/simplexml.c

index 69cc4a6b58de3b3f7765a8b7132cbb61b05b3967..99d16d779035bf3ed0e5ca6653e186b529a9baa4 100644 (file)
@@ -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);