Matt,

On Tue, 2008-07-22 at 10:52 -0500, Matt Wilmas wrote:
> Adding these two array functions has been on the TODO for a while, 

The patch can quite easily be tricked into an endless recursion of
php_array_replace_recursive() calls which will segfault:

$ php -r '$a = array(); $a[] = &$a; $b = array(); $b[] = &$b;
array_replace_recursive($a, $b);'
Segmentation fault

Some other cases were covered by PHP's recursion detection:

$ php -r '$a = array(); $a[1] = &$a; $b = array(); $b[2] = &$b;
array_replace_recursive($a, $b, array(&$a, &$b), array(&$b, &$a));'

Warning: array_replace_recursive(): recursion detected in Command line
code on line 1

Can you try to add a detection for the first case?

johannes


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to