clarify the check being performed

This commit is contained in:
Danny McClanahan 2024-05-18 04:46:17 -04:00
parent 8fbc4039a8
commit acb0a6f0c4
No known key found for this signature in database
GPG key ID: 6105C10F1A199CC7

View file

@ -722,7 +722,9 @@ impl ZipFileData {
extra_field_length += 20; extra_field_length += 20;
} }
if extra_field_length + self.central_extra_field_len() > u16::MAX as usize { if extra_field_length + self.central_extra_field_len() > u16::MAX as usize {
return Err(ZipError::InvalidArchive("Extra data field is too large")); return Err(ZipError::InvalidArchive(
"Local + central extra data fields are too large",
));
} }
let extra_field_length: u16 = extra_field_length.try_into().unwrap(); let extra_field_length: u16 = extra_field_length.try_into().unwrap();