From: Johannes Schlüter Date: Fri, 23 Oct 2009 16:47:35 +0000 (+0000) Subject: Fix #49972 (AppendIterator undefined function crash) X-Git-Tag: php-5.3.2RC1~316 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a8fc25b7d58f1f0f1a39793931db8ab1d9b4030;p=php Fix #49972 (AppendIterator undefined function crash) --- diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 8b87e30b92..7ad96ed001 100755 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1166,7 +1166,7 @@ static union _zend_function *spl_dual_it_get_method(zval **object_ptr, char *met intern = (spl_dual_it_object*)zend_object_store_get_object(*object_ptr TSRMLS_CC); function_handler = std_object_handlers.get_method(object_ptr, method, method_len TSRMLS_CC); - if (!function_handler) { + if (!function_handler && intern->inner.ce) { if (zend_hash_find(&intern->inner.ce->function_table, method, method_len+1, (void **) &function_handler) == FAILURE) { if (Z_OBJ_HT_P(intern->inner.zobject)->get_method) { *object_ptr = intern->inner.zobject; diff --git a/ext/spl/tests/bug49972.phpt b/ext/spl/tests/bug49972.phpt new file mode 100755 index 0000000000..843c2519ba --- /dev/null +++ b/ext/spl/tests/bug49972.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #49972 (AppendIterator undefined function crash) +--FILE-- +undefined(); + +?> +--EXPECTF-- +Fatal error: Call to undefined method AppendIterator::undefined() in %s on line %d