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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Tue Sep 29 21:01:24 2020 UTC