diff options
author | Yann Collet <cyan@fb.com> | 2021-05-28 07:26:30 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2021-05-28 07:56:26 (GMT) |
commit | 59273b7127417182aecdf0190e6d69f5534c4dd4 (patch) | |
tree | ea1aea1d1421dd7cf120a58d68861b6af1426fb4 /tests | |
parent | c2c0c47d5f27752097ae379645e34bcba4d604ed (diff) | |
download | lz4-59273b7127417182aecdf0190e6d69f5534c4dd4.zip lz4-59273b7127417182aecdf0190e6d69f5534c4dd4.tar.gz lz4-59273b7127417182aecdf0190e6d69f5534c4dd4.tar.bz2 |
fix UB lz4:988 and lz4:1178
ensure `dictBase` is only used
when there is an actual dictionary content.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frametest.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/frametest.c b/tests/frametest.c index f06d9b7..b3b4df8 100644 --- a/tests/frametest.c +++ b/tests/frametest.c @@ -558,7 +558,10 @@ int basicTests(U32 seed, double compressibility) cdict, NULL) ); DISPLAYLEVEL(3, "compressed %u bytes into %u bytes \n", (unsigned)dictSize, (unsigned)cSizeWithDict); - if ((LZ4_DISTANCE_MAX > dictSize) && (cSizeWithDict >= cSizeNoDict)) goto _output_error; /* must be more efficient */ + if ((LZ4_DISTANCE_MAX > dictSize) && (cSizeWithDict >= cSizeNoDict)) { + DISPLAYLEVEL(3, "cSizeWithDict (%zu) should have been more compact than cSizeNoDict(%zu) \n", cSizeWithDict, cSizeNoDict); + goto _output_error; /* must be more efficient */ + } crcOrig = XXH64(CNBuffer, dictSize, 0); DISPLAYLEVEL(3, "LZ4F_decompress_usingDict : "); |