Skip to content

ZipArchive->getStreamIndex(0) aborts after 790 of 1800 lines #17787

Open
@Wilfried-HD

Description

@Wilfried-HD

Description

The following code:

$z = new ZipArchive();
$res = $z->open(sys_get_temp_dir().'/temp.zip',ZipArchive::RDONLY |ZipArchive::CHECKCONS);
$datei = $z->getStreamIndex(0,ZipArchive::FL_UNCHANGED);

while ($z = fgets($datei)){
...
delivers only 950 Lines of 1800 in the file - aprox. 100 kB.
Ommitting the Flag ZipArchive::FL_UNCHANGED does not make any difference.

51000-0002_de_flat.zip

51000-0002_de_flat.zip

The following code works even with much larger files:
$z = new ZipArchive();
$res = $z->open(sys_get_temp_dir().'/temp.zip',ZipArchive::RDONLY |ZipArchive::CHECKCONS);
$fileName = $z->getNameIndex(0);
$z->close();
$datei = fopen('zip://'.sys_get_temp_dir().'/temp.zip#'.$fileName, 'r');

Tested with
PHP 8.2.26 Development Server in Eclipse

PHP Version

PHP 8.2.26

Operating System

Debian 12

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions