allow for garbage after comment data
This commit is contained in:
parent
fbffaed42a
commit
5c4f0906f8
1 changed files with 3 additions and 5 deletions
|
@ -66,12 +66,10 @@ impl CentralDirectoryEnd {
|
|||
reader.seek(io::SeekFrom::Current(
|
||||
BYTES_BETWEEN_MAGIC_AND_COMMENT_SIZE as i64,
|
||||
))?;
|
||||
let comment_length = reader.read_u16::<LittleEndian>()? as u64;
|
||||
if file_length - pos - HEADER_SIZE == comment_length {
|
||||
|
||||
let cde_start_pos = reader.seek(io::SeekFrom::Start(pos as u64))?;
|
||||
return CentralDirectoryEnd::parse(reader).map(|cde| (cde, cde_start_pos));
|
||||
}
|
||||
}
|
||||
pos = match pos.checked_sub(1) {
|
||||
Some(p) => p,
|
||||
None => break,
|
||||
|
|
Loading…
Add table
Reference in a new issue