summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2018-12-09 19:29:43 (GMT)
committerGitHub <noreply@github.com>2018-12-09 19:29:43 (GMT)
commit16400fb79017b1b2dd86a4a864f65930fe8586a2 (patch)
treeafea2cf53ed2bd6fc2dc37edfd63b7dc381c26ee /lib
parent077caefae6eb8c38e6264a41ae637499d2114235 (diff)
parent4e3accccb221c2e5dac90efec823a4b13fed70ae (diff)
downloadlz4-16400fb79017b1b2dd86a4a864f65930fe8586a2.zip
lz4-16400fb79017b1b2dd86a4a864f65930fe8586a2.tar.gz
lz4-16400fb79017b1b2dd86a4a864f65930fe8586a2.tar.bz2
Merge pull request #616 from felixhandte/lz4-attach-reject-short-dicts
Fix LZ4_compress_fast_continue() Prefix Size Check
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 dd9edcc..53eff2e 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1319,7 +1319,7 @@ int LZ4_compress_fast_continue (LZ4_stream_t* LZ4_stream, const char* source, ch
if (acceleration < 1) acceleration = ACCELERATION_DEFAULT;
/* invalidate tiny dictionaries */
- if ( (streamPtr->dictSize-1 < 4) /* intentional underflow */
+ if ( (streamPtr->dictSize-1 < 4-1) /* intentional underflow */
&& (dictEnd != (const BYTE*)source) ) {
DEBUGLOG(5, "LZ4_compress_fast_continue: dictSize(%u) at addr:%p is too small", streamPtr->dictSize, streamPtr->dictionary);
streamPtr->dictSize = 0;