php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14456 mcrypt_create_iv: unterminated string & segfault
Submitted: 2001-12-12 09:05 UTC Modified: 2002-04-10 19:33 UTC
From: pumuckel at metropolis dot de Assigned: derick (profile)
Status: Closed Package: mcrypt related
PHP Version: 4.1.0 OS: Linux 2.2.X
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pumuckel at metropolis dot de
New email:
PHP Version: OS:

 

 [2001-12-12 09:05 UTC] pumuckel at metropolis dot de
mcrypt_create_iv(mcrypt_get_iv_size (MCRYPT_DES , MCRYPT_MODE_ECB), MCRYPT_RAND) produces following error and causes apache to segfault:

Warning - String is not zero-terminated
source: zend_execute_API.c:274


Workaround:

Replace the mcrypt_create_iv call with:
      $fp = fopen("/dev/random", "r");
      $iv = fread($fp, mcrypt_get_iv_size (MCRYPT_DES , MCRYPT_MODE_ECB));
      fclose($fp);

Better: Should be fixed.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-12 09:15 UTC] derick@php.net
Already known
 [2001-12-12 15:48 UTC] derick@php.net
dup of #14236
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 14:01:33 2024 UTC