We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Got this report at zip-rs/zip2#215:
When testing zip file - raw.zip with code (I copied this from fuzz directory)
fn check_file(file_path: &str) { match File::open(&file_path) { Ok(file) => { let mut zip = match zip::ZipArchive::new(file) { Ok(t) => t, Err(e) => { println!("{e}"); return; } }; for i in 0..zip.len() { match zip.by_index(i) { Ok(mut file) => { let mut buf = Vec::new(); let _ = file.read(&mut buf); } Err(e) => { println!("{e}"); } } } } Err(_inspected) => (), } }
it freezes here
0x00005555556b8214 in deflate64::inflater_managed::InflaterManaged::inflate ( self=<optimized out>, input=..., output=...) at src/inflater_managed.rs:140 140 pub fn inflate(&mut self, input: &[u8], mut output: &mut [u8]) -> InflateResult { (gdb) backtrace #0 0x00005555556b8214 in deflate64::inflater_managed::InflaterManaged::inflate (self=<optimized out>, input=..., output=...) at src/inflater_managed.rs:140 #1 0x000055555565f63c in deflate64::stream::{impl#3}::read<std::io::buffered::bufreader::BufReader<zip::read::CryptoReader>> (self=0x7ffff62092d8, buf=...) at /home/rafal/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deflate64-0.1.8/src/stream.rs:52 #2 0x000055555565a3f8 in zip::crc32::{impl#1}::read<deflate64::stream::Deflate64Decoder<std::io::buffered::bufreader::BufReader<zip::read::CryptoReader>>> ( self=0x7ffff62092d8, buf=...) at src/crc32.rs:43 #3 0x000055555564eabc in zip::read::{impl#2}::read (self=<optimized out>, buf=...) at src/read.rs:176 #4 0x00005555556525d5 in zip::read::{impl#7}::read (self=0x7ffff6209110, buf=...) at src/read.rs:1484 #5 0x0000555555645e0f in ziprs::check_file (file_path=...) at src/main.rs:40 #6 0x0000555555645141 in ziprs::main () at src/main.rs:22
The text was updated successfully, but these errors were encountered:
Thank you for report.
It looks that I forget to consider empty read output buffer in Read trait implementation.
Sorry, something went wrong.
this isn't related to broken file, this always happens with empty output buffer even with valid deflate64 data.
I have released version fixed this problem as 0.1.9
Successfully merging a pull request may close this issue.
Got this report at zip-rs/zip2#215:
The text was updated successfully, but these errors were encountered: