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
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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Mon Jun 30 19:01:35 2025 UTC