php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11642 mcrypt_generic() leaks memory
Submitted: 2001-06-24 12:17 UTC Modified: 2001-10-02 18:12 UTC
From: jc at irbs dot com Assigned: derick (profile)
Status: Closed Package: mcrypt related
PHP Version: 4.0.6 OS: FreeBSD 4.3-stable
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: jc at irbs dot com
New email:
PHP Version: OS:

 

 [2001-06-24 12:17 UTC] jc at irbs dot 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 "$x\n";
?>
</PRE>

Modifying PEAR/Crypt/CBC.php to use mcrypt_ecb() instead of
mcrypt_generic() reduces memory leak to less than 1MB
after 1000 executions.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-24 16:41 UTC] derick@php.net
I'll check this out
 [2001-09-07 02:57 UTC] derick@php.net
I could not reproduce this with the latest CVS. Can you try the CVS version, or a snapshot from snaps.php.net?

Derick
 [2001-10-02 18:12 UTC] sniper@php.net
No feedback, can not reproduce.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu May 08 00:01:29 2025 UTC