ID:               49738
 Updated by:       j...@php.net
 Reported By:      terrafr...@php.net
-Status:           Open
+Status:           Feedback
 Bug Type:         mcrypt related
 Operating System: Windows XP
 PHP Version:      5.2.11
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2009-10-01 16:17:10] terrafr...@php.net

Description:
------------
In bug # 41252, it was observed that, in PHP4, calling mcrypt_generic()
before calling mcrypt_module_open() would cause PHP4 to crash.  PHP5
apparently had extra checks to protect against this that were
backported.  These extra checks, however, do not appear to be
sufficient, as the following reproduce code demonstrates.

Sure, calling mcrypt_generic_deinit() before calling mcrypt_generic is
probably not something you ought to be doing, anyway, but I still don't
think it ought to crash PHP.

Reproduce code:
---------------
<?php
$td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');
mcrypt_generic_init($td, 'aaaaaaaa', 'aaaaaaaa');
mcrypt_generic_deinit($td);
echo mcrypt_generic($td, 'aaaaaaaa');
?>

Expected result:
----------------
Warning: mcrypt_generic(): Operation disallowed prior to
mcrypt_generic_init() in {filename} on line 5


Actual result:
--------------
It crashes.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49738&edit=1

Reply via email to