]> granicus.if.org Git - php/commitdiff
Don't retain mt_rand() seeds across requests
authorx-xiang <x.xiang@outlook.com>
Wed, 8 Mar 2017 03:43:14 +0000 (11:43 +0800)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 27 Mar 2017 17:02:39 +0000 (19:02 +0200)
In particular, this prevents manual seeding of mt_rand() to leak
across requests.

ext/standard/basic_functions.c

index aaf4301d6468c961676d5794216eedf6fb1f8f5e..4784a216e16c2cca6747b578a0f765886ffccd7a 100644 (file)
@@ -3810,6 +3810,8 @@ PHP_RSHUTDOWN_FUNCTION(basic) /* {{{ */
        zend_hash_destroy(&BG(putenv_ht));
 #endif
 
+       BG(mt_rand_is_seeded) = 0;
+
        if (BG(umask) != -1) {
                umask(BG(umask));
        }