mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Fix null reference exception in FAT filesystem when entry points to a cluster beyond volume.
This commit is contained in:
@@ -192,10 +192,8 @@ namespace Aaru.Filesystems
|
||||
|
||||
if((_fat32 && entry.ea_handle << 16 > 0) ||
|
||||
entry.start_cluster > 0)
|
||||
{
|
||||
stat.Blocks = _fat32 ? GetClusters((uint)((entry.ea_handle << 16) + entry.start_cluster)).Length
|
||||
: GetClusters(entry.start_cluster).Length;
|
||||
}
|
||||
|
||||
stat.Length = stat.Blocks * stat.BlockSize;
|
||||
}
|
||||
@@ -221,7 +219,7 @@ namespace Aaru.Filesystems
|
||||
uint[] GetClusters(uint startCluster)
|
||||
{
|
||||
if(startCluster == 0)
|
||||
return null;
|
||||
return new uint[0];
|
||||
|
||||
if(startCluster >= XmlFsType.Clusters)
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user