Fix Bytes slicing buffer overrun; fix bug in the IBM decoder which was

provoking it.
This commit is contained in:
David Given
2019-03-21 20:14:35 +01:00
parent 46db85a619
commit d013b0fe55
3 changed files with 27 additions and 3 deletions

View File

@@ -20,6 +20,8 @@ SectorVector AbstractIbmDecoder::decodeToSectors(const RawRecordVector& rawRecor
{
const Bytes bytes = decodeFmMfm(rawrecord->data);
int headerSize = skipHeaderBytes();
if (bytes.size() < (headerSize + 1))
continue;
Bytes data = bytes.slice(headerSize, bytes.size() - headerSize);
switch (data[0])