dmitry Wed Nov 16 04:43:57 2005 EDT Modified files: /php-src/ext/standard basic_functions.c /php-src/ext/standard/tests/general_functions bug35229.phpt Log: Fixed bug #35229 (call_user_func() crashes when arguement_stack is nearly full) http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.735&r2=1.736&ty=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.735 php-src/ext/standard/basic_functions.c:1.736 --- php-src/ext/standard/basic_functions.c:1.735 Sun Oct 30 13:04:19 2005 +++ php-src/ext/standard/basic_functions.c Wed Nov 16 04:43:55 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.735 2005/10/30 18:04:19 iliaa Exp $ */ +/* $Id: basic_functions.c,v 1.736 2005/11/16 09:43:55 dmitry Exp $ */ #include "php.h" #include "php_streams.h" @@ -2038,7 +2038,7 @@ params = safe_emalloc(sizeof(zval **), argc, 0); - if (zend_get_parameters_array_ex(argc, params) == FAILURE) { + if (zend_get_parameters_array_ex(1, params) == FAILURE) { efree(params); RETURN_FALSE; } @@ -2058,6 +2058,11 @@ RETURN_NULL(); } + if (zend_get_parameters_array_ex(argc, params) == FAILURE) { + efree(params); + RETURN_FALSE; + } + if (call_user_function_ex(EG(function_table), NULL, *params[0], &retval_ptr, argc-1, params+1, 0, NULL TSRMLS_CC) == SUCCESS) { if (retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); http://cvs.php.net/diff.php/php-src/ext/standard/tests/general_functions/bug35229.phpt?r1=1.1&r2=1.2&ty=u Index: php-src/ext/standard/tests/general_functions/bug35229.phpt diff -u /dev/null php-src/ext/standard/tests/general_functions/bug35229.phpt:1.2 --- /dev/null Wed Nov 16 04:43:57 2005 +++ php-src/ext/standard/tests/general_functions/bug35229.phpt Wed Nov 16 04:43:56 2005 @@ -0,0 +1,30 @@ +--TEST-- +Bug #35229 (call_user_func() crashes when arguement_stack is nearly full) +--FILE-- +<?php +class test2 { + static function use_stack() { + echo "OK\n"; + } +} + +function __autoload($class) +{ + eval('class test1 extends test2 {}'); + + test1::use_stack( + 1,2,3,4,5,6,7,8,9,10, + 11,12,13,14,15,16,17,18,19,20, + 21,22,23,24,25,26,27,28,29,30 + ); +} + +call_user_func(array('test1', 'use_stack'), + 1,2,3,4,5,6,7,8,9,10, + 11,12,13,14,15,16,17,18,19,20, + 21,22,23,24,25,26,27,28,29,30 +); +?> +--EXPECT-- +OK +OK
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php