|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41252 calling mcrypt_generic without first calling mcrypt_generic_init crashes
Submitted: 2007-05-01 15:19 UTC Modified: 2007-05-01 16:07 UTC
From: Assigned: derick (profile)
Status: Closed Package: Reproducible crash
PHP Version: 4.4.6 OS: Windows XP
Private report: No CVE-ID: None
 [2007-05-01 15:19 UTC]
Calling mcrypt_generic() without first calling mcrypt_generic_init() results in a crash on PHP 4.4.6 / Windows XP running the latest version of mcrypt from  PHP 5 is unaffected.

Reproduce code:
$td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');
echo mcrypt_generic($td,'aaaaaaaa');

Expected result:
There should be some sort of error.  Here's what PHP 5.2.1 says:

Warning: mcrypt_generic(): Operation disallowed prior to mcrypt_generic_init() in {filename} on line 3

Actual result:
It crashes.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-01 15:39 UTC]
I can reproduce this on Linux. Working on backporting the extra checks.
 [2007-05-01 16:07 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Sep 26 03:01:25 2023 UTC