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

index f60fff6a6506010c55ba09f39a6e8509b38b97fe..bf2ce6fd197d5b3dae27923ec2f61b3e6416f7ad 100644 (file)
@@ -3228,6 +3228,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);