Don't try to read past partition end.

This commit is contained in:
2017-07-23 19:58:11 +01:00
parent f3e33aa7aa
commit dddf884c05
14 changed files with 44 additions and 18 deletions

View File

@@ -139,6 +139,9 @@ namespace DiscImageChef.Filesystems
if(Marshal.SizeOf(f2fsSb) % imagePlugin.GetSectorSize() != 0)
sbSize++;
if(partition.Start + sbAddr >= partition.End)
return false;
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
if(sector.Length < Marshal.SizeOf(f2fsSb))
return false;