#18947 [Opn->Csd]: memory related bug
| From: | kalowsky@php.net | Date: | Fri, 16 Aug 2002 19:54:08 +0000 |
| Subject: | #18947 [Opn->Csd]: memory related bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-17048@lists.php.net to get a copy of this message | ||
ID: 18947
Updated by: kalowsky@php.net
Reported By: pgr75@hotmail.com
-Status: Open
+Status: Closed
Bug Type: Bzip2 Related
Operating System: any
PHP Version: 4.2.2
New Comment:
Fixed in CVS.
The first was changed, the second has already been done.
Previous Comments:
------------------------------------------------------------------------
[2002-08-16 15:44:27] pgr75@hotmail.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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18947&edit=1