mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Check for overflow with incorrectly cut mode pages.
This commit is contained in:
@@ -6545,6 +6545,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
if(isSubpage)
|
||||
{
|
||||
if (offset + 3 >= modeResponse.Length)
|
||||
break;
|
||||
|
||||
pg.PageResponse = new byte[(modeResponse[offset + 2] << 8) + modeResponse[offset + 3] + 4];
|
||||
if((pg.PageResponse.Length + offset) > modeResponse.Length)
|
||||
return decoded;
|
||||
@@ -6555,6 +6558,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
else
|
||||
{
|
||||
if (offset + 1 >= modeResponse.Length)
|
||||
break;
|
||||
|
||||
pg.PageResponse = new byte[modeResponse[offset + 1] + 2];
|
||||
if((pg.PageResponse.Length + offset) > modeResponse.Length)
|
||||
return decoded;
|
||||
|
||||
Reference in New Issue
Block a user