From:
Operating system: linux
PHP version: 5.2.14
Package: Zlib Related
Bug Type: Bug
Bug description:wrong uncompressed size in append mode
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
--
Edit bug report at http://bugs.php.net/bug.php?id=52486&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52486&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52486&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52486&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52486&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52486&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52486&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52486&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52486&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52486&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52486&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52486&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52486&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52486&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52486&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52486&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52486&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52486&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52486&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52486&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52486&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52486&r=mysqlcfg