php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18947 memory related bug
Submitted: 2002-08-16 15:44 UTC Modified: 2002-08-16 15:54 UTC
From: pgr75 at hotmail dot com Assigned:
Status: Closed Package: Bzip2 Related
PHP Version: 4.2.2 OS: any
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: pgr75 at hotmail dot com
New email:
PHP Version: OS:

 

 [2002-08-16 15:44 UTC] pgr75 at hotmail dot com
Seen something similar in the bug database but dated from February and it's still in the current release.

The code under ext/bz2 has at least two bugs:

+ bzread without a length returns a string that is not '\0' terminated. On systems where (e)malloc returns a initialized memory it works fine, but when the memory is not initialized it breaks.
A quick fix is to use ecalloc instead of emalloc

+ bzcompress (and perhaps bzuncompress ?) uses a size argument for the second parameter of libz2's BZ2_bzBuffToBuffCompress function.
This parameter is NEVER initialized, it should be initialized to dest_len.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-16 15:54 UTC] kalowsky@php.net
Fixed in CVS.

The first was changed, the second has already been done.  
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC