fixed decoding bogus lz4 frame
FIO would keep presenting data after an LZ4F decoding error resulting in a NULL pointer dereference when associated with older liblz4 version (< v1.8.1.2)
This commit is contained in:
+2
-2
@@ -1487,7 +1487,7 @@ static unsigned long long FIO_decompressLz4Frame(dRess_t* ress,
|
|||||||
if (LZ4F_isError(nextToLoad)) {
|
if (LZ4F_isError(nextToLoad)) {
|
||||||
DISPLAYLEVEL(1, "zstd: %s: lz4 decompression error : %s \n",
|
DISPLAYLEVEL(1, "zstd: %s: lz4 decompression error : %s \n",
|
||||||
srcFileName, LZ4F_getErrorName(nextToLoad));
|
srcFileName, LZ4F_getErrorName(nextToLoad));
|
||||||
decodingError = 1; break;
|
decodingError = 1; nextToLoad = 0; break;
|
||||||
}
|
}
|
||||||
pos += remaining;
|
pos += remaining;
|
||||||
|
|
||||||
@@ -1495,7 +1495,7 @@ static unsigned long long FIO_decompressLz4Frame(dRess_t* ress,
|
|||||||
if (decodedBytes) {
|
if (decodedBytes) {
|
||||||
if (fwrite(ress->dstBuffer, 1, decodedBytes, ress->dstFile) != decodedBytes) {
|
if (fwrite(ress->dstBuffer, 1, decodedBytes, ress->dstFile) != decodedBytes) {
|
||||||
DISPLAYLEVEL(1, "zstd: %s \n", strerror(errno));
|
DISPLAYLEVEL(1, "zstd: %s \n", strerror(errno));
|
||||||
decodingError = 1; break;
|
decodingError = 1; nextToLoad = 0; break;
|
||||||
}
|
}
|
||||||
filesize += decodedBytes;
|
filesize += decodedBytes;
|
||||||
DISPLAYUPDATE(2, "\rDecompressed : %u MB ", (unsigned)(filesize>>20));
|
DISPLAYUPDATE(2, "\rDecompressed : %u MB ", (unsigned)(filesize>>20));
|
||||||
|
|||||||
Reference in New Issue
Block a user