fs: ext2: Fix potential integer overflow in disk access size calculation
Cast sector_count and sector_size to uint64_t to prevent potential integer overflow when calculating total device size in disk_access_device_size(). Fixes Coverity issue CID-322647 Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
parent
ab9a2f52ba
commit
7c6d3a6f93
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ static int64_t disk_access_device_size(struct ext2_data *fs)
|
||||||
{
|
{
|
||||||
struct disk_data *disk = fs->backend;
|
struct disk_data *disk = fs->backend;
|
||||||
|
|
||||||
return disk->sector_count * disk->sector_size;
|
return (uint64_t)disk->sector_count * (uint64_t)disk->sector_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t disk_access_write_size(struct ext2_data *fs)
|
static int64_t disk_access_write_size(struct ext2_data *fs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue