php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57690 PHP Crashes when using addEmptyDir method
Submitted: 2007-06-03 13:53 UTC Modified: 2009-07-20 15:21 UTC
From: darwinkid at gmail dot com Assigned:
Status: Closed Package: zip (PECL)
PHP Version: 5.2.1 OS: Windows XP Professional SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: darwinkid at gmail dot com
New email:
PHP Version: OS:

 

 [2007-06-03 13:53 UTC] darwinkid at gmail dot com
Description:
------------
PHP crashes when attempting to recreate a directory that already exists in an archive. yes it probably seems like bad practice to attempt to recreate a directory that already exists however, I found this while iterating through files/directories. the submitted code is the simpilest form in which the error can be reproduced.

Reproduce code:
---------------
<?php
// this code crashes php
$archive = new ZipArchive();
$archive->open('c:/test.zip', ZIPARCHIVE::CREATE);
$archive->addEmptyDir('test');
$archive->addEmptyDir('test');
?>

Expected result:
----------------
the expected result would be for it to completely skip over the directory and or display a E_NOTICE that the directory already exists.

Actual result:
--------------
when attempting to create a directory that already exists in an archive, PHP crashes.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-03 14:11 UTC] pierre dot php at gmail dot com
Do you use your own DLL or do you download them from snaps/pecl4win?
 [2007-06-03 14:41 UTC] darwinkid at gmail dot com
The DLL I use is the one that is distributed at 
http://us.php.net/get/pecl-5.2.1-Win32.zip/from/a/mirror

I hope this answers your question.
 [2007-06-03 15:49 UTC] pierre dot php at gmail dot com
Can you try the next Windows snapshot of PHP 5.2? See http://snaps.php.net/ (it should be online in 45min-1h).
 [2008-08-12 21:36 UTC] szm001 at tom dot com
ddd
 [2009-07-20 15:21 UTC] pierre dot php at gmail dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 18:01:31 2024 UTC