]> granicus.if.org Git - php/commitdiff
Fixed segfault in closedir
authorXinchen Hui <laruence@gmail.com>
Sun, 2 Mar 2014 14:35:24 +0000 (22:35 +0800)
committerXinchen Hui <laruence@gmail.com>
Sun, 2 Mar 2014 14:35:24 +0000 (22:35 +0800)
ext/standard/dir.c

index c92e3bb1c7f4308d34f0c76252ce3d23fe759fea..ae38a20130b47e13e4d24919a155185f074dd649 100644 (file)
@@ -80,7 +80,7 @@ static zend_class_entry *dir_class_entry_ptr;
        } \
        if (ZEND_NUM_ARGS() == 0) { \
                myself = getThis(); \
-               if (myself) { \
+               if (!ZVAL_IS_UNDEF(myself)) { \
                        if ((tmp = zend_hash_str_find(Z_OBJPROP_P(myself), "handle", sizeof("handle")-1)) == NULL) { \
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find my handle property"); \
                                RETURN_FALSE; \