]> granicus.if.org Git - php/commitdiff
fix #29954 (array_reduce segfaults when initial value is array)
authorAntony Dovgal <tony2001@php.net>
Sun, 28 Nov 2004 17:03:45 +0000 (17:03 +0000)
committerAntony Dovgal <tony2001@php.net>
Sun, 28 Nov 2004 17:03:45 +0000 (17:03 +0000)
ext/standard/array.c

index aee0609a05f6e44c924971e8cc2517294b4ff644..5c6ecf575faa8941cce35f7768fb9fa305676149 100644 (file)
@@ -3943,6 +3943,7 @@ PHP_FUNCTION(array_reduce)
        efree(callback_name);
 
        if (ZEND_NUM_ARGS() > 2) {
+               convert_to_long_ex(initial);
                result = *initial;
        } else {
                MAKE_STD_ZVAL(result);