-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consumer callback is called infinitely while extracting compressed 0byte entry #191
Comments
@weichsel I test with current development branch. It causes when entry is file (not directory). |
Thanks for updating the issue and for providing a test file. I can't promise when I'll find time to fix this, but if you need this, you can submit a PR and I'll do my best to review it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Extract a compressed 0byte file, Consumer callback is called infinitely.
I write my code using entry.uncompressedSize for bufferSize to reduce count of consumer closure is called.
(like below test)
My app has infinitely loop.
Steps to Reproduce
This test never stop.
Put testExtractCopressedEmptyData.zip to Tests/ZIPFoundationTests/Resources
To stop infinity loop, I can rewrite the extract code:
However, consumer calls twice. (It should be once)
With Xcode debugger, I notice that the test calls
Data.process
method withbufferSize
= 0.Data.process
creates 0-byte Data inifinity.NOTE: macOS can creates Zip file have 0byte compressed entry. I create sample zip file and attach in this issue.
It contains 0 byte "empty.txt" and 86336byte "faust.txt"
(zip command creates stored no-compressed entry for 0 byte file)
Method
Defl:N
means deflated entry.Expected Results
consumer closure called only once with empty data (
Data()
)Actual Results
consumer closure called infinitely.
Regression & Version
I am using v0.9.11
Xcode 12.2 & macOS 10.15.7
Related Link
The text was updated successfully, but these errors were encountered: