summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-10-28 09:57:35 +0000
committerDmitry Stogov <dmitry@php.net>2005-10-28 09:57:35 +0000
commitfa406902d5a4bd3f50d29c3e3cff723e18492c2f (patch)
tree42304c969256c8754f7ea159c167c365c4d2a5c2
parent36a14076a8902fafd355a3ad15d64a96d4bb4e31 (diff)
downloadphp-git-fa406902d5a4bd3f50d29c3e3cff723e18492c2f.tar.gz
Fixed bug #34982 (array_walk_recursive() modifies elements outside function scope)
-rw-r--r--NEWS2
-rw-r--r--ext/standard/array.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index f18a22509c..abecaad5fb 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ PHP NEWS
- Fixed fgetcsv() and fputcsv() inconsistency. (Dmitry)
- 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 #34968 (bz2 extension fails on to build on some win32 setups).
(Ilia)
diff --git a/ext/standard/array.c b/ext/standard/array.c
index fd9f2af36f..bbb4e958bd 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1072,6 +1072,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");