php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9503 bzcompress output is null padded to size of original string
Submitted: 2001-02-28 16:58 UTC Modified: 2001-03-15 20:27 UTC
From: zeekamotay at hotmail dot com Assigned:
Status: Closed Package: Bzip2 Related
PHP Version: 4.0.4pl1 OS: Linux 2.2 [RH6.2]
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: zeekamotay at hotmail dot com
New email:
PHP Version: OS:

 

 [2001-02-28 16:58 UTC] zeekamotay at hotmail dot com
I compiled PHP 4.0.4pl1 with --bz2, using bzip 1.0.1. Running bzcompress() on a string always returns a string of the same size. The data in the returned string appears to be correctlty compressed though, as it uncompresses correctly when passed back to bzdecompress(). It appears that the first part of the returned string contains the correctly compressed result, and that the returned string is then padded with nulls out to the size of the original string. The gzcompress() function does not behave this way.

<?
$str = "[...some really huge string...]";
echo
  strlen($str) . " " .
  strlen(gzcompress($str,9)) . " " .
  strlen(bzcompress($str,9));
?>

This generates the output: 14092 2348 14092

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-15 20:27 UTC] sniper@php.net
Fixed in CVS.

--Jani

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Jan 27 09:01:25 2020 UTC