Skip to content

Commit bf0abd1

Browse files
authored
random: Initialize the mode field when seeding in php_random_default_status() (php#13608)
This is a follow-up fix for phpGH-13579. The issue was detected in the nightly MSAN build.
1 parent 7f8465a commit bf0abd1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/random/random.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ PHPAPI void *php_random_default_status(void)
312312
php_random_status_state_mt19937 *state = &RANDOM_G(mt19937);
313313

314314
if (!RANDOM_G(mt19937_seeded)) {
315+
state->mode = MT_RAND_MT19937;
315316
php_random_mt19937_seed_default(state);
316317
RANDOM_G(mt19937_seeded) = true;
317318
}

0 commit comments

Comments
 (0)