Merge branch 'PHP-8.2' into PHP-8.3

* PHP-8.2:
  random: Initialize the `mode` field when seeding in `php_random_default_status()` (#13690)
This commit is contained in:
Tim Düsterhus 2024-03-13 20:14:00 +01:00
commit 0d0375ab91
No known key found for this signature in database
GPG Key ID: 8FF75566094168AF
2 changed files with 3 additions and 0 deletions

2
NEWS
View File

@ -29,6 +29,8 @@ PHP NEWS
- Random:
. Fixed bug GH-13544 (Pre-PHP 8.2 compatibility for mt_srand with unknown
modes). (timwolla)
. Fixed bug GH-13690 (Global Mt19937 is not properly reset in-between
requests when MT_RAND_PHP is used). (timwolla)
- Session:
. Fixed bug GH-13680 (Segfault with session_decode and compilation error).

View File

@ -315,6 +315,7 @@ PHPAPI php_random_status *php_random_default_status(void)
php_random_status *status = RANDOM_G(mt19937);
if (!RANDOM_G(mt19937_seeded)) {
((php_random_status_state_mt19937 *)status->state)->mode = MT_RAND_MT19937;
php_random_mt19937_seed_default(status->state);
RANDOM_G(mt19937_seeded) = true;
}