]> 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:04:18 +0000 (17:04 +0000)
committerAntony Dovgal <tony2001@php.net>
Sun, 28 Nov 2004 17:04:18 +0000 (17:04 +0000)
ext/standard/array.c

index 1392103c00039e1f29180a2d273a1de60ed8b49d..619aa85779d4a7a91e1a38cdd5aada0d220f94ba 100644 (file)
@@ -3836,6 +3836,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);