[php-src] PHP-8.6: Fix free of uninitialized date last_errors after a failed request startup (#25127)

From: Date: Sun, 01 Nov 2026 16:59:23 +0000
Subject: [php-src] PHP-8.6: Fix free of uninitialized date last_errors after a failed request startup (#25127)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-143170@lists.php.net to get a copy of this message
Author: Kévin Dunglas (dunglas) Committer: Weilin Du (LamentXU123) Date: 2026-11-02T00:35:44+08:00 Commit: https://github.com/php/php-src/commit/7091e5b029f24b7d091dee73432c2cca260a90fe Raw diff: https://github.com/php/php-src/commit/7091e5b029f24b7d091dee73432c2cca260a90fe.diff Fix free of uninitialized date last_errors after a failed request startup (#25127) In ZTS builds, date globals are allocated per thread, but last_errors was only initialized in RINIT. If the first request fails before module activation, the post-deactivate hook can free an uninitialized pointer. Initialize last_errors in GINIT alongside the other pointers. Closes #25127 Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index ab03c7b63557..d97dc0825937 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -388,6 +388,7 @@ static PHP_GINIT_FUNCTION(date) date_globals->default_timezone = NULL; date_globals->timezone = NULL; date_globals->tzcache = NULL; + date_globals->last_errors = NULL; } /* }}} */

« previous php.cvs (#143170) next »