Skip to content

Commit

Permalink
Fix use-of-uninitialized-value of EG(last_fatal_error_backtrace) with…
Browse files Browse the repository at this point in the history
… ZTS (GH-17639)

Static variables are zeroed, but ts memory is not. Hence, we need to do
it ourselves.
  • Loading branch information
iluuu1994 authored Jan 31, 2025
1 parent b4f275f commit 16c9652
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,8 @@ void zend_startup(zend_utility_functions *utility_functions) /* {{{ */
CG(map_ptr_last) = 0;
#endif /* ZTS */
EG(error_reporting) = E_ALL & ~E_NOTICE;
EG(fatal_error_backtrace_on) = false;
ZVAL_UNDEF(&EG(last_fatal_error_backtrace));

zend_interned_strings_init();
zend_startup_builtin_functions();
Expand Down

0 comments on commit 16c9652

Please sign in to comment.