summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Terrell <terrelln@fb.com>2018-04-23 21:21:02 (GMT)
committerNick Terrell <terrelln@fb.com>2018-04-23 21:21:02 (GMT)
commit672799e8149c4c9b89f767801209721a59012c91 (patch)
tree60e2661c3e0b415b4e1e3931d0db3d1a3cdf3f41
parentbb83cad98fdb15a7ade4cde582b98e836fb8ef11 (diff)
downloadlz4-672799e8149c4c9b89f767801209721a59012c91.zip
lz4-672799e8149c4c9b89f767801209721a59012c91.tar.gz
lz4-672799e8149c4c9b89f767801209721a59012c91.tar.bz2
Fix compilation error and assert.
-rw-r--r--lib/lz4.c2
-rw-r--r--tests/fuzzer.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 870ab5a..40b2229 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1530,7 +1530,7 @@ LZ4_FORCE_INLINE int LZ4_decompress_generic(
unsigned const token = *ip++;
- assert(ip <= iend); /* ip < iend before the increment */
+ assert(!endOnInput || ip <= iend); /* ip < iend before the increment */
/* shortcut for common case :
* in most circumstances, we expect to decode small matches (<= 18 bytes) separated by few literals (<= 14 bytes).
* this shortcut was tested on x86 and x64, where it improves decoding speed.
diff --git a/tests/fuzzer.c b/tests/fuzzer.c
index def5230..6fd27fc 100644
--- a/tests/fuzzer.c
+++ b/tests/fuzzer.c
@@ -500,7 +500,6 @@ static int FUZ_test(U32 seed, U32 nbCycles, const U32 startCycle, const double c
/* Test decoding shortcut edge case */
FUZ_DISPLAYTEST("LZ4_decompress_safe() with shortcut edge case");
{ char tmp[17];
- unsigned long i;
/* 14 bytes of literals, followed by a 14 byte match.
* Should not read beyond the end of the buffer.
* See https://github.com/lz4/lz4/issues/508. */