ID: 45222 Updated by: [EMAIL PROTECTED] Reported By: crabbydata at gmail dot com -Status: Open +Status: Feedback Bug Type: Zip Related -Operating System: MS Vista +Operating System: Windows Vista PHP Version: 5.2.6 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi Previous Comments: ------------------------------------------------------------------------ [2008-06-09 18:22:25] crabbydata at gmail dot com Description: ------------ When creating a new zip-file with the "ZipArchive::CREATE"-function, and there already is a zipfile with the given filename Apache will crash without any warning (just a Vista error popup saying it has already stopped working). Reproduce code: --------------- <?php $zip = new ZipArchive(); $zipfile = "myveryownzipfile.zip"; if($zip->open($zipfile, ZipArchive::CREATE) !== true) exit("Can't create file ".$zipfile); // Add stuff inside the zip-file $zip->addFromString('tmp', 'bla'); // temporary file within zip $zip->close(); // Same code as above so two identical files are (tried to be) created if($zip->open($zipfile, ZipArchive::CREATE) !== true) exit("Can't create file ".$zipfile); // Add stuff inside the zip-file $zip->addFromString('tmp', 'bla'); // temporary file within zip $zip->close(); ?> Expected result: ---------------- When the second file is created, it should give out the exit-error: "Can't create file myveryownzipfile.zip". Or it should give a "fatal error!"-notice of PHP itself saying the filename already exists or simply that the (second) file could not be created (e.g. "duplicate filename"). Actual result: -------------- When activating this script (only with the creation of a single zipfile) through a form, and submitting it repeatingly (fast(!)), a (Vista) error pops up saying "Apache.exe doesn't work any longer" and Apache has been forced to shut down. Screenshots (I've a Dutch-language Vista): (1) http://img377.imageshack.us/img377/8170/06092008200500jp7.png Translation: "Apache HTTP Server has stopped working Searching for a solution..." (2) http://img156.imageshack.us/img156/4051/06092008195928sd1.png Translation: "Apache HTTP Server has stopped working An error occured which made the program function incorrectly. The program will now be closed and you'll get a notice when a solution is available." I installed/run PHP through the XAMPP-package (http://www.apachefriends.org/en/xampp.html). Zip-module information: Extension Version: $Id: php_zip.c,v 1.1.2.38 2007/08/06 22:02:32 bjori Exp $ Zip version: 2.0.0 Libzip version: 0.7.1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45222&edit=1