com php-src: Fixed un-initilized iterator in DirectoyItrator: ext/reflection/php_reflection.c ext/spl/spl_directory .c

From: Date: Fri, 28 Feb 2014 08:06:47 +0000
Subject: com php-src: Fixed un-initilized iterator in DirectoyItrator: ext/reflection/php_reflection.c ext/spl/spl_directory .c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77876@lists.php.net to get a copy of this message
Commit: b353d5abe95675fab70f66ee79d8f503bc7f1e69 Author: Xinchen Hui <laruence@gmail.com> Fri, 28 Feb 2014 16:06:47 +0800 Parents: 0def388427d42dbcb2c4775335b4559039026588 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b353d5abe95675fab70f66ee79d8f503bc7f1e69 Log: Fixed un-initilized iterator in DirectoyItrator Changed paths: M ext/reflection/php_reflection.c M ext/spl/spl_directory.c Diff: diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index e82e132..bbe66fb 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4175,7 +4175,7 @@ ZEND_METHOD(reflection_class, isInstance) Returns an instance of this class */ ZEND_METHOD(reflection_class, newInstance) { - zval *retval_ptr = NULL; + zval retval; reflection_object *intern; zend_class_entry *ce, *old_scope; zend_function *constructor; @@ -4216,7 +4216,7 @@ ZEND_METHOD(reflection_class, newInstance) ZVAL_UNDEF(&fci.function_name); fci.symbol_table = NULL; fci.object_ptr = return_value; - fci.retval = retval_ptr; + fci.retval = &retval; fci.param_count = num_args; fci.params = params; fci.no_separation = 1; @@ -4231,15 +4231,15 @@ ZEND_METHOD(reflection_class, newInstance) if (params) { efree(params); } - if (retval_ptr) { - zval_ptr_dtor(retval_ptr); + if (!ZVAL_IS_UNDEF(&retval)) { + zval_ptr_dtor(&retval); } php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invocation of %s's constructor failed", ce->name->val); zval_dtor(return_value); RETURN_NULL(); } - if (retval_ptr) { - zval_ptr_dtor(retval_ptr); + if (!ZVAL_IS_UNDEF(&retval)) { + zval_ptr_dtor(&retval); } if (params) { efree(params); diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index fcfeb33..604aca7 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -158,6 +158,7 @@ static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type TS zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); + zend_iterator_init(&intern->it.intern TSRMLS_CC); intern->std.handlers = &spl_filesystem_object_handlers; return &intern->std;

« previous php.cvs (#77876) next »