summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNick Terrell <terrelln@fb.com>2016-11-05 02:59:50 (GMT)
committerNick Terrell <terrelln@fb.com>2016-11-05 03:01:23 (GMT)
commit920bf21714f99cc20d3b8bcc28060136a390354a (patch)
tree6057917cbd5ac8599b22736ef2db83ad48ec9654 /lib
parent8195ba8f7bbf0153a1dc01d2ada8823a29462afa (diff)
downloadlz4-920bf21714f99cc20d3b8bcc28060136a390354a.zip
lz4-920bf21714f99cc20d3b8bcc28060136a390354a.tar.gz
lz4-920bf21714f99cc20d3b8bcc28060136a390354a.tar.bz2
Fix LZ4_decompress_fast_continue() bug
It specified the external dictionary location incorrectly. Add tests that expose this bug with both normal compilation and ASAN.
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 6db4c0b..740ae64 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1366,7 +1366,7 @@ int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const ch
lz4sd->prefixEnd += originalSize;
} else {
lz4sd->extDictSize = lz4sd->prefixSize;
- lz4sd->externalDict = (BYTE*)dest - lz4sd->extDictSize;
+ lz4sd->externalDict = lz4sd->prefixEnd - lz4sd->extDictSize;
result = LZ4_decompress_generic(source, dest, 0, originalSize,
endOnOutputSize, full, 0,
usingExtDict, (BYTE*)dest, lz4sd->externalDict, lz4sd->extDictSize);