|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67161 ZipArchive::getStream() returns NULL for certain file
Submitted: 2014-04-30 19:30 UTC Modified: 2015-05-12 12:37 UTC
From: bugs dot php dot net at tjbp dot net Assigned: jpauli (profile)
Status: Closed Package: Zip Related
PHP Version: 5.5.11 OS: Arch Linux x64
Private report: No CVE-ID: None
 [2014-04-30 19:30 UTC] bugs dot php dot net at tjbp dot net
According to the documentation, ZipArchive::getStream() will return the contents of a file, or false on failure. I'm receiving NULL for a certain file in an archive, though the archive passes validation with unzip -t.

The archive in question:

Test script:
$za = new \ZipArchive;



Expected result:
Contents of the file in the archive

Actual result:


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-12 16:09 UTC] cmbecker69 at gmx dot de
I assume the file can't be read, because it is compressed with
Deflate64 (byte 0x140 of is 0x09), and this compression
method is likely to be unsupported.

The NULL return value is the result of zip_stat() succeeding, but
php_stream_zip_open() failing in ZipArchive::getStream()[1]. A

  else {
at the end of the method would return FALSE, but the return value
of NULL may well be by design, and if so the documentation should
be improved.

[1] <>
 [2015-04-16 12:54 UTC]
-Package: zip +Package: Zip Related
 [2015-05-01 20:23 UTC]
-Status: Open +Status: Analyzed
 [2015-05-12 12:37 UTC]
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: jpauli
 [2015-05-12 12:37 UTC]
Please try using this snapshot:
For Windows:

Merged against master
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 21:01:28 2024 UTC