1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

random: Initialize the mode field when seeding in php_random_default_status() (#13608)

This is a follow-up fix for GH-13579. The issue was detected in the nightly
MSAN build.
This commit is contained in:
Tim Düsterhus
2024-03-06 18:57:17 +01:00
committed by GitHub
parent 7f8465ab22
commit bf0abd1629

View File

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