|  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.
Block user comment
Status: Assign to:
Bug Type:
From: denis at bitrix dot ru
New email:
PHP Version: OS:


 [2010-07-29 13:08 UTC] denis at bitrix dot ru
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);

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

# gzip -l tmp.gz

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


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: Sat Apr 20 14:01:29 2024 UTC