Add several out of bounds and null protections against rogue MMC firmwares.

This commit is contained in:
2018-06-19 21:35:23 +01:00
parent bdaece414e
commit 414262f574
3 changed files with 12 additions and 3 deletions

View File

@@ -228,9 +228,12 @@ namespace DiscImageChef.Commands
if(decMode.Value.Header.BlockDescriptors != null && decMode.Value.Header.BlockDescriptors.Length >= 1)
scsiDensityCode = (byte)decMode.Value.Header.BlockDescriptors[0].Density;
containsFloppyPage =
decMode.Value.Pages.Aggregate(containsFloppyPage,
(current, modePage) => current | (modePage.Page == 0x05));
if(decMode.Value.Pages != null)
{
containsFloppyPage =
decMode.Value.Pages.Aggregate(containsFloppyPage,
(current, modePage) => current | (modePage.Page == 0x05));
}
}
switch(dev.ScsiType)