diff --git a/NEWS b/NEWS index 6dba7db8a4037..94a1605a224f4 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ PHP NEWS . Fixed bug GH-16040 (Use-after-free of object released in hook). (ilutov) . Fixed bug GH-16054 (Segmentation fault when resizing hash table iterator list while adding). (nielsdos) + . Fixed bug GH-15905 (Assertion failure for TRACK_VARS_SERVER). (cmb) - DOM: . Fixed bug GH-16039 (Segmentation fault (access null pointer) in diff --git a/main/php_variables.c b/main/php_variables.c index c3b773516e37f..7569fd43e900c 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -893,6 +893,7 @@ static bool php_auto_globals_create_server(zend_string *name) } else { zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_SERVER]); array_init(&PG(http_globals)[TRACK_VARS_SERVER]); + zend_hash_real_init_mixed(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER])); } check_http_proxy(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER])); diff --git a/tests/basic/gh15905.phpt b/tests/basic/gh15905.phpt new file mode 100644 index 0000000000000..6636b97024276 --- /dev/null +++ b/tests/basic/gh15905.phpt @@ -0,0 +1,12 @@ +--TEST-- +GH-15905 (Assertion failure for TRACK_VARS_SERVER) +--INI-- +variables_order=E +auto_globals_jit=0 +register_argc_argv=1 +--FILE-- + +--EXPECT-- +okay