From 9bf088ce36ac52d96349647804a15499d932e92a Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 20 Jan 2007 22:16:24 +0000 Subject: [PATCH] Fixed bug #39450 (getenv() fills other super-globals). --- NEWS | 1 + main/php_variables.c | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 217fe23860..195a20b123 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? Jan 2007, PHP 5.2.1RC4 - Fixed bug #40169 (CURLOPT_TCP_NODELAY only available in curl >= 7.11.2). (Tony) +- Fixed bug #39450 (getenv() fills other super-globals). (Ilia, Tony) 18 Jan 2007, PHP 5.2.1RC3 - Added read-timeout context option "timeout" for HTTP streams. (Hannes, diff --git a/main/php_variables.c b/main/php_variables.c index 6bc0156db8..9754b4f347 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -621,8 +621,6 @@ int php_hash_environment(TSRMLS_D) { char *p; unsigned char _gpc_flags[5] = {0, 0, 0, 0, 0}; - zval *dummy_track_vars_array = NULL; - zend_bool initialized_dummy_track_vars_array=0; zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals) && !PG(register_long_arrays)); struct auto_global_record { char *name; @@ -713,15 +711,9 @@ int php_hash_environment(TSRMLS_D) continue; } if (!PG(http_globals)[i]) { - if (!initialized_dummy_track_vars_array) { - ALLOC_ZVAL(dummy_track_vars_array); - array_init(dummy_track_vars_array); - INIT_PZVAL(dummy_track_vars_array); - initialized_dummy_track_vars_array = 1; - } else { - dummy_track_vars_array->refcount++; - } - PG(http_globals)[i] = dummy_track_vars_array; + ALLOC_ZVAL(PG(http_globals)[i]); + array_init(PG(http_globals)[i]); + INIT_PZVAL(PG(http_globals)[i]); } PG(http_globals)[i]->refcount++; -- 2.40.0