|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-04-07 15:05 UTC] pajoye@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: pajoye
[2011-04-07 15:05 UTC] pajoye@php.net
[2011-04-07 15:15 UTC] arno at renevier dot net
[2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 03:00:02 2025 UTC |
Description: ------------ Hi, I've encountered the bug when trying to unzip a file into a full disk. ZipArchive::extractTo reported true, but the extracted file had a 0 size. It would be nice if extractTo had reported false, so I could have known something was wrong. I've experienced the bug with debian php 5.3.6-7 and with php build from php5.3-201104071030.tar.bz2 with ./configure --enable-zip && make May be php_zip_extract_file could return 0 if php_stream_write returns 0 in the n=zip_fread loop PS: this bug may be the same as #53893 but as I'm unsure, I prefer to open a new one. Test script: --------------- function unzip ($file) { $za = new \ZipArchive(); if ($za->open($file) === FALSE) { throw new Exception ("invalid zip file " . $file); } if ($za->numFiles != 1) { throw new Exception ("invalid zip file " . $file); } if (($archive = $za->getNameIndex(0)) === FALSE) { throw new Exception ("invalid zip file " . $file); } if ($za->extractTo('target', $archive) === FALSE) { throw new Exception ("could not extract archive " . $archive); } if ($za->close() === FALSE) { throw new Exception ("could not extract archive " . $archive); } } unzip('somefile.zip'); Expected result: ---------------- the script should throw an exception. Actual result: -------------- no exception is thrown.