From: TorokAlpar at Gmail dot com
Operating system: Windows Xp, Linux
PHP version: 5.3.0
PHP Bug Type: Zip Related
Bug description: feof never returns true for damaged file in zip
Description:
------------
Opening a damaged zip archive (7z reports CRC failed for the faulty file),
feof never return true, the script blocks, causing high CPU usage.
Please contact me to get a zip that produces this problem. I don't see how
can i attach it here
Reproduce code:
---------------
$o = new ZipArchive();
if (! $o->open('test.zip',ZipArchive::CHECKCONS)) {
exit ('error can\'t open');
}
$o->getStream('file2'); // this file is ok
echo "OK";
$r = $o->getStream('file1'); // this file has a wrong crc
while (! feof($r)) {
fread($r,1024);
}
echo "never here\n";
Expected result:
----------------
The script either reads the file ignoring the crc error, or reports the
error, but finishes.
Actual result:
--------------
the script never ends, and uses up the CPU
--
Edit bug report at http://bugs.php.net/?id=49072&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=49072&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=49072&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=49072&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=49072&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=49072&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=49072&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=49072&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=49072&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=49072&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=49072&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=49072&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=49072&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=49072&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=49072&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49072&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49072&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=49072&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=49072&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=49072&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=49072&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=49072&r=mysqlcfg