Bug #11642 Updated: mcrypt_generic() leaks memory
| From: | derick@php.net | Date: | Sun, 24 Jun 2001 20:41:14 +0000 |
| Subject: | Bug #11642 Updated: mcrypt_generic() leaks memory | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-57870@lists.php.net to get a copy of this message | ||
ID: 11642
Updated by: derick
Reported By: jc@irbs.com
Old-Status: Open
Status: Assigned
Bug Type: mcrypt related
Operating system:
PHP Version: 4.0.6
Assigned To: derick
Comments:
I'll check this out
Previous Comments:
---------------------------------------------------------------------------
[2001-06-24 12:17:53] jc@irbs.com
Minimal configuration
./configure --without-mysql --with-apache=../apache_1.3.20 --without-gd --without-zlib
--without-gdbm
--without-shared-apache --with-mcrypt
libmcrypt versions 2.2.7, 2.4.10, 2.4.11, 2.4.15
php versions 4.0.4pl1, 4.0.5, 4.0.6
This script leaks about 6MB per execution on my system.
<PRE>
<?
$key = "87654321";
for ($i = 500; $i--; )
$input .= '1234567890';
require("Crypt/CBC.php");
$CBC = new Crypt_CBC($key, "DES");
$block = $CBC->encrypt($input);
$x = $CBC->decrypt($block);
if ($x != $input)
print "$xn";
?>
</PRE>
Modifying PEAR/Crypt/CBC.php to use mcrypt_ecb() instead of
mcrypt_generic() reduces memory leak to less than 1MB
after 1000 executions.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11642&edit=2