php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52486 wrong uncompressed size in append mode
Submitted: 2010-07-29 13:08 UTC Modified: 2010-08-23 17:52 UTC
From: denis at bitrix dot ru Assigned:
Status: Closed Package: Zlib related
PHP Version: 5.2.14 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: denis at bitrix dot ru
New email:
PHP Version: OS:

 

 [2010-07-29 13:08 UTC] denis at bitrix dot ru
Description:
------------
The last 4 bytes in GZIP file must contain the size of uncompressed data.
When you write in append mode, php writes just the size of the last chunk.

Test script:
---------------
<?
$str = '0123456789'; // 10 bytes

$f = gzopen('tmp.gz','w');
gzwrite($f, $str);
gzclose($f);

$f = gzopen('tmp.gz','a');
gzwrite($f, $str);
gzclose($f);
?>

# gzip -l tmp.gz

Expected result:
----------------
uncompressed
20

Actual result:
--------------
uncompressed
10

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-23 17:52 UTC] denis at bitrix dot ru
-Status: Open +Status: Closed
 [2010-08-23 17:52 UTC] denis at bitrix dot ru
I was wrong.
This is normal behavior.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 02:01:28 2024 UTC