summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2021-05-28 07:26:30 (GMT)
committerYann Collet <cyan@fb.com>2021-05-28 07:56:26 (GMT)
commit59273b7127417182aecdf0190e6d69f5534c4dd4 (patch)
treeea1aea1d1421dd7cf120a58d68861b6af1426fb4 /tests
parentc2c0c47d5f27752097ae379645e34bcba4d604ed (diff)
downloadlz4-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.c5
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 : ");