diff options
author | Antony Dovgal <tony2001@php.net> | 2007-04-08 08:04:30 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2007-04-08 08:04:30 +0000 |
commit | 5f0b474146e03cc630852a8d254eede1cc79b4e9 (patch) | |
tree | 8b8d0457f9a1d824228eb74c754aebf3e5ac1976 | |
parent | 8bb69d5e0d04112cf199cd1c0a8d8d1eb2a50716 (diff) | |
download | php-git-5f0b474146e03cc630852a8d254eede1cc79b4e9.tar.gz |
MFB: fix #40999 (mcrypt_create_iv() not using random seed)
-rw-r--r-- | ext/mcrypt/mcrypt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 52b114e566..261690ea5f 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -35,6 +35,7 @@ #include "php_ini.h" #include "php_globals.h" #include "ext/standard/info.h" +#include "ext/standard/php_rand.h" static int le_mcrypt; @@ -1039,8 +1040,7 @@ int php_mcrypt_iv(php_mcrypt_iv_source source, int size, char **iv_str, int *iv_ case PHP_MCRYPT_IV_SOURCE_RAND: *iv_len = size; while (size) { - unsigned int ctx; - (*iv_str)[--size] = 255.0 * php_rand_r(&ctx) / RAND_MAX; + (*iv_str)[--size] = 255.0 * php_rand(TSRMLS_C) / RAND_MAX; } break; } |