Skip to content
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

Crash when files in ZIP have no date #411

Closed
freijon opened this issue May 8, 2023 · 3 comments · Fixed by #433
Closed

Crash when files in ZIP have no date #411

freijon opened this issue May 8, 2023 · 3 comments · Fixed by #433
Labels
bug Something isn't working

Comments

@freijon
Copy link
Contributor

freijon commented May 8, 2023

Version

0.4.1

Description

When trying to decompress a ZIP that contains files with no modifying and/or creation date, ouch crashes.

Current Behavior

ouch crashes with the following message

[INFO] Created temporary directory /mnt/c/Users/jonas.frei/Documents/tmp/dl/./.tmpPENU32 to hold decompressed elements.
[INFO] ".tmpPENU32/ch6f_34080_091a_1.dxf" extracted. (313.98KiB)
thread 'main' panicked at 'Zip archive contains a file with broken 'last modified time': ComponentRange { name: "month", minimum: 1, maximum: 12, value: 0, conditional_range: false }', src/archive/zip.rs:267:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Expected Behavior

Shouldn't crash, use current datetime

Additional Information

I think usually the files in a ZIP do have this metadata. Those ZIP files were generated by a tool that apparently doesn't include this information.

@freijon freijon added the bug Something isn't working label May 8, 2023
@marcospb19
Copy link
Member

marcospb19 commented May 8, 2023

Can you attach the example archive for me to try this and use it to debug?

I need to investigate if this is possible to handle.

@freijon
Copy link
Contributor Author

freijon commented May 9, 2023

Here you go: 411-example.zip

@marcospb19
Copy link
Member

Thank you! Opening a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants