#18947 [NEW]: memory related bug
| From: | pgr75 at hotmail dot com | Date: | Fri, 16 Aug 2002 19:44:28 +0000 |
| Subject: | #18947 [NEW]: memory related bug | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-17047@lists.php.net to get a copy of this message | ||
From: pgr75@hotmail.com
Operating system: any
PHP version: 4.2.2
PHP Bug Type: Bzip2 Related
Bug description: memory related bug
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 bug report at http://bugs.php.net/?id=18947&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=18947&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=18947&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18947&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18947&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18947&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18947&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18947&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18947&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18947&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18947&r=globals