summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNick Terrell <terrelln@fb.com>2019-07-18 19:20:29 (GMT)
committerNick Terrell <terrelln@fb.com>2019-07-18 19:20:29 (GMT)
commit7c32101c655d93b61fc212dcd512b87119dd7333 (patch)
tree2c3334f38fd03312df1036d456f551fbf8dd2679 /lib
parent19b099986aeccc12bb46ad207fe8de5b36bdb7bc (diff)
downloadlz4-7c32101c655d93b61fc212dcd512b87119dd7333.zip
lz4-7c32101c655d93b61fc212dcd512b87119dd7333.tar.gz
lz4-7c32101c655d93b61fc212dcd512b87119dd7333.tar.bz2
[LZ4_compress_destSize] Fix off-by-one error in fix
The next match is looking at the current ip, not the next ip, so it needs to be cleared as well. Credit to OSS-Fuzz
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 74a9247..70424b9 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1042,7 +1042,7 @@ _next_match:
*/
const BYTE* ptr;
DEBUGLOG(5, "Clearing %u positions", (U32)(filledIp - ip));
- for (ptr = ip + 1; ptr <= filledIp; ++ptr) {
+ for (ptr = ip; ptr <= filledIp; ++ptr) {
U32 const h = LZ4_hashPosition(ptr, tableType);
LZ4_clearHash(h, cctx->hashTable, tableType);
}