summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2020-11-08 21:21:58 (GMT)
committerYann Collet <cyan@fb.com>2020-11-08 21:21:58 (GMT)
commit2964b8a6f6d93e86af52f2d23ec18f02421ebd74 (patch)
treefc32430dd3fb9b1a9585733fd41b59e5b8e1c33e /lib
parentbe634559e3b6bb7bce77cc83ec2080b2bfb6c844 (diff)
downloadlz4-2964b8a6f6d93e86af52f2d23ec18f02421ebd74.zip
lz4-2964b8a6f6d93e86af52f2d23ec18f02421ebd74.tar.gz
lz4-2964b8a6f6d93e86af52f2d23ec18f02421ebd74.tar.bz2
fix #874
coverity reported a warning regarding a memcpy() overwrite. This is a false positive (the memory area is large enough), but it's true that it's not trivial to determine (encompassing struct), and it's proper anyway to only memcpy() just the right amount of data.
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 427673e..aca97ed 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1606,7 +1606,7 @@ int LZ4_compress_fast_continue (LZ4_stream_t* LZ4_stream,
* cost to copy the dictionary's tables into the active context,
* so that the compression loop is only looking into one table.
*/
- LZ4_memcpy(streamPtr, streamPtr->dictCtx, sizeof(LZ4_stream_t));
+ LZ4_memcpy(streamPtr, streamPtr->dictCtx, sizeof(*streamPtr));
result = LZ4_compress_generic(streamPtr, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, usingExtDict, noDictIssue, acceleration);
} else {
result = LZ4_compress_generic(streamPtr, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, usingDictCtx, noDictIssue, acceleration);