mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix GH-18145: basic_globals_ctor initialization
This resets all basic globals during ctor and just modifies the ones with a special value. It also switches to using basic_globals_p which what should be used in this context. Closes GH-18156
This commit is contained in:
parent
f994c2f1fa
commit
2197a490f7
2 changed files with 11 additions and 22 deletions
4
NEWS
4
NEWS
|
@ -55,6 +55,10 @@ PHP NEWS
|
||||||
. Fixed bug GH-18018 (RC1 data returned from offsetGet causes UAF in
|
. Fixed bug GH-18018 (RC1 data returned from offsetGet causes UAF in
|
||||||
ArrayObject). (nielsdos)
|
ArrayObject). (nielsdos)
|
||||||
|
|
||||||
|
- Standard:
|
||||||
|
. Fixed bug GH-18145 (php8ts crashes in php_clear_stat_cache()).
|
||||||
|
(Jakub Zelenka)
|
||||||
|
|
||||||
- Treewide:
|
- Treewide:
|
||||||
. Fixed bug GH-17736 (Assertion failure zend_reference_destroy()). (nielsdos)
|
. Fixed bug GH-17736 (Assertion failure zend_reference_destroy()). (nielsdos)
|
||||||
|
|
||||||
|
|
|
@ -215,31 +215,16 @@ static void php_putenv_destructor(zval *zv) /* {{{ */
|
||||||
|
|
||||||
static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */
|
static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */
|
||||||
{
|
{
|
||||||
BG(umask) = -1;
|
memset(basic_globals_p, 0, sizeof(php_basic_globals));
|
||||||
BG(user_tick_functions) = NULL;
|
|
||||||
BG(user_filter_map) = NULL;
|
|
||||||
BG(serialize_lock) = 0;
|
|
||||||
|
|
||||||
memset(&BG(serialize), 0, sizeof(BG(serialize)));
|
basic_globals_p->umask = -1;
|
||||||
memset(&BG(unserialize), 0, sizeof(BG(unserialize)));
|
basic_globals_p->url_adapt_session_ex.type = 1;
|
||||||
|
|
||||||
memset(&BG(url_adapt_session_ex), 0, sizeof(BG(url_adapt_session_ex)));
|
zend_hash_init(&basic_globals_p->url_adapt_session_hosts_ht, 0, NULL, NULL, 1);
|
||||||
memset(&BG(url_adapt_output_ex), 0, sizeof(BG(url_adapt_output_ex)));
|
zend_hash_init(&basic_globals_p->url_adapt_output_hosts_ht, 0, NULL, NULL, 1);
|
||||||
|
|
||||||
BG(url_adapt_session_ex).type = 1;
|
basic_globals_p->page_uid = -1;
|
||||||
BG(url_adapt_output_ex).type = 0;
|
basic_globals_p->page_gid = -1;
|
||||||
|
|
||||||
zend_hash_init(&BG(url_adapt_session_hosts_ht), 0, NULL, NULL, 1);
|
|
||||||
zend_hash_init(&BG(url_adapt_output_hosts_ht), 0, NULL, NULL, 1);
|
|
||||||
|
|
||||||
#if defined(_REENTRANT)
|
|
||||||
memset(&BG(mblen_state), 0, sizeof(BG(mblen_state)));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BG(page_uid) = -1;
|
|
||||||
BG(page_gid) = -1;
|
|
||||||
|
|
||||||
BG(syslog_device) = NULL;
|
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue