File php-5.1.2-CVE-2007-2727.patch of Package php
--- ext/mcrypt/mcrypt.c
+++ 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;
@@ -1278,7 +1279,7 @@
} else {
n = size;
while (size) {
- iv[--size] = 255.0 * rand() / RAND_MAX;
+ iv[--size] = 255.0 * php_rand(TSRMLS_C) / RAND_MAX;
}
}
RETURN_STRINGL(iv, n, 0);