From 9c41e5804e4ac7675db94a8a3efa5b28454622fc Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Mon, 15 Apr 2019 02:11:59 -0700 Subject: [PATCH] assert() the failed test ensure canary remains within buffer limits --- tests/frametest.c | 1 + 1 file changed, 1 insertion(+) 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 !"); -- 2.7.4