com php-src: Don't retain mt_rand() seeds across re quests: ext/standard/basic_functions.c

[email protected] (Nikita Popov)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    e9e860a05be187862a0213f8c6c58aff2293bb22
Author:    x-xiang <[email protected]>         Wed, 8 Mar 2017 11:43:14 +0800
Committer: Nikita Popov <[email protected]>      Mon, 27 Mar 2017 19:02:39 +0200
Parents:   727b21c839a2b7e85ba432d77d6072023c76077b
Branches:  PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=e9e860a05be187862a0213f8c6c58aff2293bb22

Log:
Don't retain mt_rand() seeds across requests

In particular, this prevents manual seeding of mt_rand() to leak
across requests.

Changed paths:
  M  ext/standard/basic_functions.c


Diff:
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index aaf4301..4784a21 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -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));
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.