php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14162 wrong init with mcrypt_generic_init crashes php
Submitted: 2001-11-21 11:23 UTC Modified: 2001-12-15 08:21 UTC
From: alberty at neptunelabs dot com Assigned:
Status: Closed Package: mcrypt related
PHP Version: 4.0CVS-2001-11-21 OS: i686-pc-linux-gnu
Private report: No CVE-ID: None
 [2001-11-21 11:23 UTC] alberty at neptunelabs dot com
Hi,

php crashes with libmcrypt (ive test it with 2.4.17) with the follow
php script.

The problem is the complete wrong initalising with mcrypt_generic_init.
The mcrypt_generic_init results -3 and mcrypt_generic crashes.

<?php
$stream='Hello World!';
$td = @mcrypt_module_open (MCRYPT_ARCFOUR , '', MCRYPT_MODE_STREAM, '');
if ($td!=false){
	$result=@mcrypt_generic_init ($td, false, false);
	if ($result!=-1){
		$stream = mcrypt_generic ($td, $stream);
		mcrypt_generic_deinit ($td);
	}
}
echo $stream;
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-15 08:21 UTC] derick@php.net
Fixed in CVS. Please note that the return value as noted in the PHP Manual was not correct. This function returns a negative value on error.
BTW, encrypting without password is not very smart, so speicifying FALSE there makes no sense.

You can try a snapshot from snaps.php.net later toda, to see if it is really fixed (ie, it doesn't crash anymore).

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 04:01:32 2024 UTC