Add regression test for #40
This commit is contained in:
parent
1b4d31839b
commit
2dae0d4a5c
2 changed files with 14 additions and 0 deletions
14
src/read.rs
14
src/read.rs
|
@ -386,3 +386,17 @@ impl<'a> Read for ZipFile<'a> {
|
|||
self.get_reader().read(buf)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
#[test]
|
||||
fn invalid_offset() {
|
||||
use std::io;
|
||||
use super::ZipArchive;
|
||||
|
||||
let mut v = Vec::new();
|
||||
v.extend_from_slice(include_bytes!("../tests/data/invalid_offset.zip"));
|
||||
let reader = ZipArchive::new(io::Cursor::new(v));
|
||||
assert!(reader.is_err());
|
||||
}
|
||||
}
|
||||
|
|
BIN
tests/data/invalid_offset.zip
Normal file
BIN
tests/data/invalid_offset.zip
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue