ID: 49072
Updated by: pajoye@php.net
Reported By: TorokAlpar at Gmail dot com
-Status: No Feedback
+Status: Assigned
Bug Type: Zip Related
Operating System: Windows Xp, Linux
PHP Version: 5.3.0
New Comment:
I really don't like this auto no feedback ...
Previous Comments:
------------------------------------------------------------------------
[2009-08-11 15:12:00] svn@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=287095
Log: - fixed bug #49072, feof never returns true for damaged file in
zip
------------------------------------------------------------------------
[2009-08-04 01:00:01] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2009-07-27 12:39:19] pajoye@php.net
Please send me the archive you used to reproduce this problem.
------------------------------------------------------------------------
[2009-07-27 11:47:13] TorokAlpar at Gmail dot com
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 this bug report at http://bugs.php.net/?id=49072&edit=1