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

Unable to read edge case deflate64 ZIP file #241

Open
nhz2 opened this issue Aug 28, 2024 · 1 comment
Open

Unable to read edge case deflate64 ZIP file #241

nhz2 opened this issue Aug 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@nhz2
Copy link

nhz2 commented Aug 28, 2024

Describe the bug
Unable to read edge case deflate64 ZIP file.

To Reproduce
When I try to read the file:
deflate64-edgecase.zip

using the example code in:
https://github.com/zip-rs/zip2/blob/6d3945645b7f3805068dd8c50d4fe56a66651069/tests/deflate64.rs

I get:

failures:

---- decompress_deflate64 stdout ----
thread 'decompress_deflate64' panicked at tests/deflate642.rs:19:10:
couldn't read encrypted and compressed file: Custom { kind: InvalidInput, error: "invalid deflate64" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    decompress_deflate64

Expected behavior

This zip file contains a single entry named "foo" with 65539 copies of the byte 0x8F

According to 7zip this file is valid:

$ 7z t deflate64-edgecase.zip 

7-Zip (z) 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20
 64-bit locale=en_US.UTF-8 Threads:16 OPEN_MAX:1024, ASM

Scanning the drive for archives:
1 file, 158 bytes (1 KiB)

Testing archive: deflate64-edgecase.zip
--
Path = deflate64-edgecase.zip
Type = zip
Physical Size = 158

Everything is Ok

Size:       65539
Compressed: 158

Additional context

I manually created this file to test edgecases for deflate64 because I am trying to add support for deflate64 to my zip archive package https://github.com/JuliaIO/ZipArchives.jl

The actual deflate64 data is:

[0xeb, 0x1f, 0xfd, 0xff, 0x07, 0x00]

I'm not sure if this kind of file could be naturally created.

@nhz2 nhz2 added the bug Something isn't working label Aug 28, 2024
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

No branches or pull requests

2 participants
@nhz2 and others