]> granicus.if.org Git - php/commitdiff
Fixed bug #39450 (getenv() fills other super-globals).
authorIlia Alshanetsky <iliaa@php.net>
Sat, 20 Jan 2007 22:16:24 +0000 (22:16 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 20 Jan 2007 22:16:24 +0000 (22:16 +0000)
NEWS
main/php_variables.c

diff --git a/NEWS b/NEWS
index 217fe238607f69111a7ce83a875b44b502341def..195a20b12305a8796d64176cf33d267fe8ee2f31 100644 (file)
--- 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,
index 6bc0156db87efaac8ca0941032ff7fb66749677f..9754b4f3478f30421421321f7956bffbeccc4c8f 100644 (file)
@@ -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++;