Bug #63195 [Fbk->NoF]: bzread reads 1st block only

From: Date: Sun, 19 Jan 2020 04:22:04 +0000
Subject: Bug #63195 [Fbk->NoF]: bzread reads 1st block only
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224984@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63195&edit=1 ID: 63195 Updated by: php-bugs@lists.php.net Reported by: exception0x876 at gmail dot com Summary: bzread reads 1st block only -Status: Feedback +Status: No Feedback Type: Bug Package: Bzip2 Related Operating System: Linux CentOS 5.8 PHP Version: 5.3.17 Assigned To: cmb Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2020-01-05 10:58:46] cmb@php.net Do you still experience this issue with an actively supported PHP version[1] using some recent libbzip2? [1] <https://www.php.net/supported-versions.php> ------------------------------------------------------------------------ [2012-10-02 08:05:41] exception0x876 at gmail dot com Actually I was wrong about expected result. It should be decompressed data size, not the archive size. ------------------------------------------------------------------------ [2012-10-02 07:57:55] exception0x876 at gmail dot com Description: ------------ It seems bzread reads only the 1st block of that specific archive. The archive size is: ls -l test.bz2 -rw-r--r-- 1 1000 users 2082194364 Oct 1 07:21 test.bz2 I can extract the archive just fine with system bzip2. Test script: --------------- <?php $filename = 'test.bz2'; $uncompressed = ''; $fp = bzopen($filename, 'r'); if (!$fp) die("Could not open $filename\n"); $size = 0; while (!feof($fp)) { $buf = bzread($fp, 4096); $size+= strlen($buf); if ($buf === false) die("File read problem\n"); $arr = bzerror($fp); if ($arr['errno'] !== 0) die("Compression problem ".$arr['errstr']."\n"); } var_dump($size); bzclose($fp); Expected result: ---------------- int(2082194364) Actual result: -------------- int(900000) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63195&edit=1

« previous php.bugs (#224984) next »