Bug fixes: validation was too stringent
This commit is contained in:
parent
c90a8fd3cf
commit
dd83186928
1 changed files with 2 additions and 11 deletions
13
src/read.rs
13
src/read.rs
|
@ -397,19 +397,10 @@ impl<R: Read + Seek> ZipArchive<R> {
|
|||
}
|
||||
};
|
||||
// It has both, so check if the zip64 footer is valid; if not, assume zip32
|
||||
if archive_offset_64 < u32::MAX as u64 && archive_offset_64 != archive_offset_32
|
||||
|| archive_offset_32 != u32::MAX as u64
|
||||
{
|
||||
if directory_start_64 - archive_offset_64 != directory_start_32 - archive_offset_32 {
|
||||
return Ok((archive_offset_32, directory_start_32, number_of_files_32));
|
||||
}
|
||||
if directory_start_64 < u32::MAX as u64 && directory_start_64 != directory_start_32
|
||||
|| directory_start_32 != u32::MAX as u64
|
||||
{
|
||||
return Ok((archive_offset_32, directory_start_32, number_of_files_32));
|
||||
}
|
||||
if number_of_files_64 < u32::MAX as usize && number_of_files_64 != number_of_files_32
|
||||
|| number_of_files_32 != u32::MAX as usize
|
||||
{
|
||||
if number_of_files_64 != number_of_files_32 && number_of_files_32 != u16::MAX as usize {
|
||||
return Ok((archive_offset_32, directory_start_32, number_of_files_32));
|
||||
}
|
||||
// It is, so we assume a zip64
|
||||
|
|
Loading…
Add table
Reference in a new issue