colder Wed Mar 12 13:34:47 2008 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests bug41828.phpt
Modified files:
/php-src/ext/spl spl_iterators.c
Log:
Fix bug #41828 (Fix crash on wrong instantiation)
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.30.2.28.2.6&r2=1.73.2.30.2.28.2.7&diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.6
php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.7
--- php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28.2.6 Thu Jan 10 10:11:33 2008
+++ php-src/ext/spl/spl_iterators.c Wed Mar 12 13:34:47 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.c,v 1.73.2.30.2.28.2.6 2008/01/10 10:11:33 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.73.2.30.2.28.2.7 2008/03/12 13:34:47 colder Exp $
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -699,8 +699,13 @@
union _zend_function *function_handler;
spl_recursive_it_object *object =
(spl_recursive_it_object*)zend_object_store_get_object(*object_ptr TSRMLS_CC);
long level = object->level;
- zval *zobj = object->iterators[level].zobject;
-
+ zval *zobj;
+
+ if (!object->iterators) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "The %s instance
wasn't initialized properly", Z_OBJCE_PP(object_ptr)->name);
+ }
+ zobj = object->iterators[level].zobject;
+
function_handler = std_object_handlers.get_method(object_ptr, method,
method_len TSRMLS_CC);
if (!function_handler) {
if (zend_hash_find(&Z_OBJCE_P(zobj)->function_table, method,
method_len+1, (void **) &function_handler) == FAILURE) {
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug41828.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/bug41828.phpt
+++ php-src/ext/spl/tests/bug41828.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php