|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
7 + 29 = ?
Subscribe to this entry?

 [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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-16 15:54 UTC]
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: Sat Dec 05 18:01:22 2020 UTC