summaryrefslogtreecommitdiffstats
path: root/lib/lz4.c
diff options
context:
space:
mode:
authorBellaXlp <2273816832@qq.com>2020-08-12 21:42:10 (GMT)
committerGitHub <noreply@github.com>2020-08-12 21:42:10 (GMT)
commitab713923a24d52a6c3d0835627b3f0d715955467 (patch)
treea36aeabb98f3cc461085eadf9c4b72a93d625f12 /lib/lz4.c
parentf9f3fdfb1cb3b359a81247b9b72e08f435a1f5e3 (diff)
downloadlz4-ab713923a24d52a6c3d0835627b3f0d715955467.zip
lz4-ab713923a24d52a6c3d0835627b3f0d715955467.tar.gz
lz4-ab713923a24d52a6c3d0835627b3f0d715955467.tar.bz2
fix issue #783 (#862)
* fix issue #783
Diffstat (limited to 'lib/lz4.c')
-rw-r--r--lib/lz4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 1cd7322..162a36a 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1931,7 +1931,7 @@ LZ4_decompress_generic(
/* If we're in this block because of the input parsing condition, then we must be on the
* last sequence (or invalid), so we must check that we exactly consume the input.
*/
- if ((ip+length>iend-(2+1+LASTLITERALS)) && (ip+length != iend)) { goto _output_error; }
+ if ((ip+length>iend-(2+1+LASTLITERALS)) && (ip+length != iend) && (cpy != oend)) { goto _output_error; }
assert(ip+length <= iend);
/* We are finishing in the middle of a literals segment.
* Break after the copy.