Guard against reading beyond partition end when identifying F2FS filesystem. Fixes #578

This commit is contained in:
2021-06-03 12:52:00 +01:00
parent 2962cc4d61
commit 7f423077ad

View File

@@ -73,7 +73,7 @@ namespace Aaru.Filesystems
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0)
sbSize++;
if(partition.Start + sbAddr >= partition.End)
if(partition.Start + sbAddr + sbSize >= partition.End)
return false;
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);