diff options
author | Yann Collet <cyan@fb.com> | 2019-04-15 09:11:59 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2019-04-15 09:11:59 (GMT) |
commit | 9c41e5804e4ac7675db94a8a3efa5b28454622fc (patch) | |
tree | b77c15a2b5eb2aa2e0dd08b1c6e8d26b992cbc22 /tests | |
parent | c222dd9010377efb7b2e87655fbec94a5b47f549 (diff) | |
download | lz4-9c41e5804e4ac7675db94a8a3efa5b28454622fc.zip lz4-9c41e5804e4ac7675db94a8a3efa5b28454622fc.tar.gz lz4-9c41e5804e4ac7675db94a8a3efa5b28454622fc.tar.bz2 |
assert() the failed test
ensure canary remains within buffer limits
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frametest.c | 1 |
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 !"); |