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
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: 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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Mon Sep 28 13:01:23 2020 UTC