mirror of
https://github.com/acidanthera/audk.git
synced 2025-09-25 18:48:42 +02:00
Ext4Pkg: Fix division by zero by adding check for s_inodes_per_group
Superblock s_inodes_per_group field can't be zero, it leads to division by zero in BlockGroup routine Ext4ReadInode Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
This commit is contained in:
parent
2d406aacfb
commit
bc05eacaa3
@ -243,6 +243,11 @@ Ext4OpenSuperblock (
|
||||
|
||||
DEBUG ((DEBUG_FS, "Read only = %u\n", Partition->ReadOnly));
|
||||
|
||||
if (Sb->s_inodes_per_group == 0) {
|
||||
DEBUG ((DEBUG_ERROR, "[ext4] Inodes per group can not be zero\n"));
|
||||
return EFI_VOLUME_CORRUPTED;
|
||||
}
|
||||
|
||||
Partition->BlockSize = (UINT32)LShiftU64 (1024, Sb->s_log_block_size);
|
||||
|
||||
// The size of a block group can also be calculated as 8 * Partition->BlockSize
|
||||
|
Loading…
x
Reference in New Issue
Block a user