iliaa           Thu Apr  5 01:48:56 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/mcrypt mcrypt.c 
    /php-src    NEWS 
  Log:
  
  Fixed bug #40999 (mcrypt_create_iv() not using random seed).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mcrypt/mcrypt.c?r1=1.91.2.3.2.9&r2=1.91.2.3.2.10&diff_format=u
Index: php-src/ext/mcrypt/mcrypt.c
diff -u php-src/ext/mcrypt/mcrypt.c:1.91.2.3.2.9 
php-src/ext/mcrypt/mcrypt.c:1.91.2.3.2.10
--- php-src/ext/mcrypt/mcrypt.c:1.91.2.3.2.9    Thu Feb 15 01:40:36 2007
+++ php-src/ext/mcrypt/mcrypt.c Thu Apr  5 01:48:56 2007
@@ -16,7 +16,7 @@
    |          Derick Rethans <[EMAIL PROTECTED]>                    |
    +----------------------------------------------------------------------+
  */
-/* $Id: mcrypt.c,v 1.91.2.3.2.9 2007/02/15 01:40:36 iliaa Exp $ */
+/* $Id: mcrypt.c,v 1.91.2.3.2.10 2007/04/05 01:48:56 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -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;
 
@@ -1274,10 +1275,9 @@
                        RETURN_FALSE;
                }
        } else {
-               unsigned int ctx;
                n = size;
                while (size) {
-                       iv[--size] = 255.0 * php_rand_r(&ctx) / RAND_MAX;
+                       iv[--size] = 255.0 * php_rand(TSRMLS_C) / RAND_MAX;
                }
        }
        RETURN_STRINGL(iv, n, 0);
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.626&r2=1.2027.2.547.2.627&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.626 php-src/NEWS:1.2027.2.547.2.627
--- php-src/NEWS:1.2027.2.547.2.626     Wed Apr  4 21:27:55 2007
+++ php-src/NEWS        Thu Apr  5 01:48:56 2007
@@ -46,6 +46,7 @@
 - Fixed zend_llist_remove_tail (Michael Wallner, Dmitry)
 - Fixed a thread safety issue in gd gif read code (Nuno, Roman Nemecek)
 - Fixed CVE-2007-1001, GD wbmp used with invalid image size (Pierre)
+- Fixed bug #40999 (mcrypt_create_iv() not using random seed). (Ilia)
 - Fixed bug #40998 (long session array keys are truncated). (Tony)
 - Implement feature request #40947, allow a single filter as argument 
   for filter_var_array (Pierre)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to