Check FAT's EA file has correct magic.

This commit is contained in:
2019-04-27 16:44:43 +01:00
parent 574e80cd6e
commit 3d8f0f2380
3 changed files with 14 additions and 1 deletions

View File

@@ -602,6 +602,18 @@ namespace DiscImageChef.Filesystems.FAT
cultureInfo = new CultureInfo("en-US", false);
directoryCache = new Dictionary<string, Dictionary<string, DirectoryEntry>>();
// Check it is really an OS/2 EA file
if(eaDirEntry.start_cluster != 0)
{
ulong secadd = firstClusterSector + eaDirEntry.start_cluster * sectorsPerCluster;
byte[] eadata =
imagePlugin.ReadSectors(firstClusterSector + eaDirEntry.start_cluster * sectorsPerCluster,
sectorsPerCluster);
ushort eamagic = BitConverter.ToUInt16(eadata, 0);
if(eamagic != EADATA_MAGIC) eaDirEntry = new DirectoryEntry();
}
mounted = true;
return Errno.NoError;
}