mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Corrected when EVPD is smaller than length field.
This commit is contained in:
@@ -434,6 +434,8 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
descriptor.Type = (IdentificationTypes)(pageResponse[position + 1] & 0x0F);
|
descriptor.Type = (IdentificationTypes)(pageResponse[position + 1] & 0x0F);
|
||||||
descriptor.Length = pageResponse[position + 3];
|
descriptor.Length = pageResponse[position + 3];
|
||||||
descriptor.Binary = new byte[descriptor.Length];
|
descriptor.Binary = new byte[descriptor.Length];
|
||||||
|
if(descriptor.Length + position + 4 >= pageResponse.Length)
|
||||||
|
descriptor.Length = (byte)(pageResponse.Length - position - 4);
|
||||||
Array.Copy(pageResponse, position + 4, descriptor.Binary, 0, descriptor.Length);
|
Array.Copy(pageResponse, position + 4, descriptor.Binary, 0, descriptor.Length);
|
||||||
if(descriptor.CodeSet == IdentificationCodeSet.ASCII)
|
if(descriptor.CodeSet == IdentificationCodeSet.ASCII)
|
||||||
descriptor.ASCII = StringHandlers.CToString(descriptor.Binary);
|
descriptor.ASCII = StringHandlers.CToString(descriptor.Binary);
|
||||||
|
|||||||
Reference in New Issue
Block a user