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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user