weichsel / ZIPFoundation

Effortless ZIP Handling in Swift
MIT License
2.31k stars 255 forks source link

ZIP files with 0-length entries cause corruptedData error #272

Closed jmecom closed 8 months ago

jmecom commented 1 year ago

Summary

ZIP files with 0-length files cause corruptedData error.

Steps to Reproduce

Call unzipItem on a ZIP with a 0-length entry.

Expected Results

The ZIP should decompress and extract, including the 0-length file. This is the behavior on MacOS.

Actual Results

corruptedData error is returned.

Regression & Version

Version: 0.9.0

Related Link

weichsel commented 1 year ago

Hi, Thanks for reporting this issue. I tried to reproduce the problem, but for me, zero-length entries are extracted without errors. Can you share your code and the affected ZIP archive? I attached a small sample workspace that extracts an archive containing an empty entry into a temp directory on launch.

EmptyEntryIssue.zip