Skip to content

Commit

Permalink
Fixed bug #34982 (array_walk_recursive() modifies elements outside fu…
Browse files Browse the repository at this point in the history
…nction scope)
  • Loading branch information
dstogov committed Oct 28, 2005
1 parent a3182ac commit 759a8b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -6,6 +6,8 @@ PHP NEWS
- Renamed CachingRecursiveIterator to RecursiveCachingIterator. (Marcus)
- Fixed bug #34996 (ImageTrueColorToPalette() crashes when ncolors is
zero). (Tony)
- Fixed bug #34982 (array_walk_recursive() modifies elements outside function
scope). (Dmitry)
- Fixed bug #34977 (Compile failure on MacOSX due to use of varargs.h). (Tony)
- Fixed bug #34950 (Unable to get WSDL through proxy). (Dmitry)
- Fixed bug #34938 (dns_get_record() doesn't resolve long hostnames and
Expand Down
1 change: 1 addition & 0 deletions ext/standard/array.c
Expand Up @@ -1050,6 +1050,7 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive
if (recursive && Z_TYPE_PP(args[0]) == IS_ARRAY) {
HashTable *thash;

SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]);
thash = HASH_OF(*(args[0]));
if (thash == target_hash) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
Expand Down

0 comments on commit 759a8b9

Please sign in to comment.