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,11 +66,9 @@ impl CentralDirectoryEnd {
|
||||||
reader.seek(io::SeekFrom::Current(
|
reader.seek(io::SeekFrom::Current(
|
||||||
BYTES_BETWEEN_MAGIC_AND_COMMENT_SIZE as i64,
|
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))?;
|
||||||
let cde_start_pos = reader.seek(io::SeekFrom::Start(pos as u64))?;
|
return CentralDirectoryEnd::parse(reader).map(|cde| (cde, cde_start_pos));
|
||||||
return CentralDirectoryEnd::parse(reader).map(|cde| (cde, cde_start_pos));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
pos = match pos.checked_sub(1) {
|
pos = match pos.checked_sub(1) {
|
||||||
Some(p) => p,
|
Some(p) => p,
|
||||||
|
|
Loading…
Add table
Reference in a new issue