mirror of
https://github.com/chenxiaolong/avbroot.git
synced 2026-07-03 14:05:11 +02:00
bootimage: Fix panic when validating vendor v4 table size
The multiplication can overflow. (Found by honggfuzz) Issue: #160 Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This commit is contained in:
@@ -1020,7 +1020,7 @@ impl<R: Read> FromReader<R> for VendorBootImageV3Through4 {
|
||||
"vendor_ramdisk_table_entry_size",
|
||||
table_entry_size,
|
||||
));
|
||||
} else if table_size != table_entry_num * table_entry_size {
|
||||
} else if table_entry_num.checked_mul(table_entry_size) != Some(table_size) {
|
||||
return Err(Error::InvalidFieldValue(
|
||||
"vendor_ramdisk_table_size",
|
||||
table_size,
|
||||
|
||||
Reference in New Issue
Block a user