Corrected check of ISO9660 SA length/offset.

This commit is contained in:
2017-11-08 17:04:32 +00:00
parent 02fe67d2d5
commit 7d6674d7f5

View File

@@ -314,7 +314,7 @@ namespace DiscImageChef.Filesystems.ISO9660
} }
} }
if(sa_off >= sa_len) if(sa_off + 2 >= sa_len)
break; break;
ushort nextSignature = BigEndianBitConverter.ToUInt16(sa, sa_off); ushort nextSignature = BigEndianBitConverter.ToUInt16(sa, sa_off);
@@ -360,7 +360,7 @@ namespace DiscImageChef.Filesystems.ISO9660
sa_off += sa[sa_off + 2]; sa_off += sa[sa_off + 2];
noneFound = false; noneFound = false;
while(sa_off < sa_len) while(sa_off + 2 < sa_len)
{ {
nextSignature = BigEndianBitConverter.ToUInt16(sa, sa_off); nextSignature = BigEndianBitConverter.ToUInt16(sa, sa_off);