mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed bug #39450 (getenv() fills other super-globals).
This commit is contained in:
parent
1b002cf39f
commit
9bf088ce36
2 changed files with 4 additions and 11 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue