php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55168 mcrypt_create_iv uses E_ERROR on Win and E_WARNING on *nix
Submitted: 2011-07-09 15:33 UTC Modified: 2011-07-11 12:53 UTC
From: ircmaxell at gmail dot com Assigned: iliaa (profile)
Status: Closed Package: mcrypt related
PHP Version: 5.4SVN-2011-07-09 (SVN) OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ircmaxell at gmail dot com
New email:
PHP Version: OS:

 

 [2011-07-09 15:33 UTC] ircmaxell at gmail dot com
Description:
------------
If you call mcrypt_create_iv with either the MCRYPT_DEV_RANDOM or 
MCRYPT_DEV_URANDOM constants, and it cannot generate enough data, it issues an 
E_ERROR fatal error.  However, on linux when the same situation it will just 
issue 
an E_WARNING.

I suggest that it should be changed from an E_ERROR to an E_WARNING on Windows 
(as 
it certainly is recoverable).

See:

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_4/ext/mcrypt/mcrypt.c?
revision=311033&view=markup

Specifically lines 1397 and 1422


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-11 12:53 UTC] iliaa@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: iliaa
 [2011-07-11 12:53 UTC] iliaa@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 00:01:31 2025 UTC