summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2019-04-15 09:11:59 (GMT)
committerYann Collet <cyan@fb.com>2019-04-15 09:11:59 (GMT)
commit9c41e5804e4ac7675db94a8a3efa5b28454622fc (patch)
treeb77c15a2b5eb2aa2e0dd08b1c6e8d26b992cbc22
parentc222dd9010377efb7b2e87655fbec94a5b47f549 (diff)
downloadlz4-9c41e5804e4ac7675db94a8a3efa5b28454622fc.zip
lz4-9c41e5804e4ac7675db94a8a3efa5b28454622fc.tar.gz
lz4-9c41e5804e4ac7675db94a8a3efa5b28454622fc.tar.bz2
assert() the failed test
ensure canary remains within buffer limits
-rw-r--r--tests/frametest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/frametest.c b/tests/frametest.c
index e4205a3..b1c7c02 100644
--- a/tests/frametest.c
+++ b/tests/frametest.c
@@ -893,6 +893,7 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi
DISPLAYLEVEL(7,"canaryByte at pos %u / %u \n",
(unsigned)((size_t)(op - (BYTE*)compressedBuffer) + dstEndSize),
(unsigned)compressedBufferSize);
+ assert(op + dstEndSize < (BYTE*)compressedBuffer + compressedBufferSize);
op[dstEndSize] = canaryByte;
result = LZ4F_compressEnd(cCtx, op, dstEndSize, &cOptions);
CHECK(op[dstEndSize] != canaryByte, "LZ4F_compressEnd writes beyond dstCapacity !");