mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add a guard for FAT12 and FAT16 to prevent an exception on invalid FAT chains.
This commit is contained in:
@@ -258,6 +258,9 @@ namespace Aaru.Filesystems
|
||||
while(nextCluster > 0 &&
|
||||
nextCluster <= FAT16_FORMATTED)
|
||||
{
|
||||
if(nextCluster > _fatEntries.Length)
|
||||
return null;
|
||||
|
||||
clusters.Add(nextCluster);
|
||||
nextCluster = _fatEntries[nextCluster];
|
||||
}
|
||||
@@ -265,6 +268,9 @@ namespace Aaru.Filesystems
|
||||
while(nextCluster > 0 &&
|
||||
nextCluster <= FAT12_FORMATTED)
|
||||
{
|
||||
if(nextCluster > _fatEntries.Length)
|
||||
return null;
|
||||
|
||||
clusters.Add(nextCluster);
|
||||
nextCluster = _fatEntries[nextCluster];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user