Guard against reading beyond partition end when identifying UNICOS filesystem. Fixes #581

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

View File

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