Skip to content

Zipfile >4GB with complex dir tree is created incorrectly #617

@kdesjard

Description

@kdesjard

A zipfile whose contents exceeds 4GB and has a fairly complex tree, is incorrectly created.

The example program https://github.com/zip-rs/zip2/blob/master/examples/write_dir.rs and version 7.2.0 running on linux was used to test this. Also, none of the files are greater than 4GB.

If you do not add the directories:

zip.add_directory(path_as_string, options)?;

then the zip file is correct.

Using zipdetails on the incorrect zipfile you have these errors:

WARNING!                                                                                                                               
Zip local header not found at offset 0x17D                                                                                             
Skipping 0x13eaed8e6 bytes to Central Directory...   

...

CENTRAL HEADER ref Local #2C: 'b803dca6-5fbc-57aa-be7f-cdf25bc43471/SUBDIR2/SUBSUBDIR_FILES/' matches with CENTRAL HEADER ref Local #1: 'b803dca6-5fbc-57aa-be7f-cdf25bc43471/'
                                                                                                                                       
                                                                                                                                       
Unexpected END at offset 13EAEEDB1, value 00000001
                                                                                                                                       
WARNINGS                                                                                                                               
                                                                   
* Expected Zip header not found at offset 0x17D, skipped 0x13EAED8E6 bytes                                                             
                                                                                                                                       
* 1 duplicate entries

If I remove some of the files to make the zipfile less than 4GB, the zipfile is correct.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions