Add regression test for #40

This commit is contained in:
Mathijs van de Nes 2017-07-05 21:36:47 +02:00
parent 1b4d31839b
commit 2dae0d4a5c
2 changed files with 14 additions and 0 deletions

View file

@ -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());
}
}

Binary file not shown.