1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 16:52:18 +01:00
Files
archived-php-src/ext/standard/tests/array/bug70713.phpt
2018-10-14 19:45:12 +02:00

27 lines
436 B
PHP

--TEST--
Bug #70713: Use After Free Vulnerability in array_walk()/array_walk_recursive()
--FILE--
<?php
class obj
{
function __tostring()
{
global $arr;
$arr = 1;
for ($i = 0; $i < 5; $i++) {
$v[$i] = 'hi'.$i;
}
return 'hi';
}
}
$arr = array('string' => new obj);
array_walk_recursive($arr, 'settype');
?>
--EXPECTF--
Warning: array_walk_recursive(): Iterated value is no longer an array or object in %s on line %d