|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77668 ZipArchive::close crashes
Submitted: 2019-02-25 21:25 UTC Modified: 2019-02-26 10:26 UTC
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: mario at snowpaws dot de Assigned: cmb (profile)
Status: Not a bug Package: Zip Related
PHP Version: 7.3.2 OS: Windows 10/Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mario at snowpaws dot de
New email:
PHP Version: OS:


 [2019-02-25 21:25 UTC] mario at snowpaws dot de
If the file date/time is set to  -1, the method ZipArchive::close() crashes on windows.

We used

Test script:
  echo "1";
  $f=fopen('test.jpg', 'w'); fputs($f, 'foobar'); fclose($f);
  touch('test.jpg', -1);
  $zip=new ZipArchive();
  $zip->open('', ZipArchive::CREATE);

  echo "2";

Expected result:
Output: 12

Actual result:
Output: 1

and only 1 temporally zip name is created, for example


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-26 10:26 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2019-02-26 10:26 UTC]
I can confirm the segfault.  It is, however, not a PHP but rather
a libzip issue, since libzip calls localtime()[1] without checking
whether it returns NULL (which it does on Windows, if a negative
sourceTime is passed[2]).

Please report this issue at <>.

[1] <>
[2] <>
 [2019-02-26 13:01 UTC] mario at snowpaws dot de
This issue seems to be fixed, see
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jun 19 03:01:23 2021 UTC