ext2: Restrict range of First_Data_Block
diff --git a/src/filo-fs-ext2.adb b/src/filo-fs-ext2.adb
index c7ea867..0d3df60 100644
--- a/src/filo-fs-ext2.adb
+++ b/src/filo-fs-ext2.adb
@@ -58,7 +58,7 @@
end if;
Static.Part_Len := Part_Len;
- Static.First_Data_Block := FSBlock_Offset (Read_LE32 (Super_Block, 5 * 4));
+ Static.First_Data_Block := Read_LE32 (Super_Block, 5 * 4);
declare
S_Log_Block_Size : constant Unsigned_32 := Read_LE32 (Super_Block, 6 * 4);
@@ -678,7 +678,7 @@
Group : constant Group_Index := Group_Index ((Inode - 1) / Static.Inodes_Per_Group);
Desc_Block : constant FSBlock_Offset :=
- 1 + Static.First_Data_Block + FSBlock_Offset (Group / Static.Desc_Per_Block);
+ 1 + FSBlock_Offset (Static.First_Data_Block) + FSBlock_Offset (Group / Static.Desc_Per_Block);
Cache_Start, Cache_End : Max_Block_Index;
begin
Cache_FSBlock