Skip to content

Commit ee278d8

Browse files
committed
fix: re-initialize per request for rng global state
1 parent d4ac6f1 commit ee278d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/random/random.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ PHP_MSHUTDOWN_FUNCTION(random)
844844

845845
php_random_status_free(RANDOM_G(combined_lcg), true);
846846
RANDOM_G(combined_lcg) = NULL;
847+
847848
php_random_status_free(RANDOM_G(mt19937), true);
848849
RANDOM_G(mt19937) = NULL;
849850

@@ -858,6 +859,9 @@ PHP_RINIT_FUNCTION(random)
858859
ZEND_TSRMLS_CACHE_UPDATE();
859860
#endif
860861

862+
RANDOM_G(combined_lcg_seeded) = false;
863+
RANDOM_G(mt19937_seeded) = false;
864+
861865
return SUCCESS;
862866
}
863867
/* }}} */

0 commit comments

Comments
 (0)