Throw exception when verification of crc32c fails
Summary
In DriveGeneric.cpp, when reading a file from tape with LBP we compare the crc32c that comes in the data block against the crc32 that we generate from the the data.
What is the current bug behaviour?
No exception is thrown.
What is the expected correct behaviour?
Exception should be thrown.
Cause
We only declare the exception, we do not throw it. Missing keyword throw
.
if (cta::verifyCrc32cForMemoryBlockWithCrc32c(
SCSI::logicBlockProtectionMethod::CRC32CSeed,
res, dataWithCrc32c)) {
// everything is fine here do mem copy
memcpy(data,dataWithCrc32c,count);
delete[] dataWithCrc32c;
} else {
delete[] dataWithCrc32c;
>>>>> cta::exception::Exception(context+"Failed checksum verification for ST read"
" in DriveGeneric::readBlock");
}
break;