summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2021-04-30 15:56:25 (GMT)
committerGitHub <noreply@github.com>2021-04-30 15:56:25 (GMT)
commit7a966c1511816b53ac93aa2f2a2ff97e036a4a60 (patch)
tree86edd8624abe303b38fd654a7dfc14a7b2a406ca /lib
parent7d8d1075e696d585238e6aa6a4f43dc759da250e (diff)
parent8301a21773ef61656225e264f4f06ae14462bca7 (diff)
downloadlz4-7a966c1511816b53ac93aa2f2a2ff97e036a4a60.zip
lz4-7a966c1511816b53ac93aa2f2a2ff97e036a4a60.tar.gz
lz4-7a966c1511816b53ac93aa2f2a2ff97e036a4a60.tar.bz2
Merge pull request #972 from jasperla/memmove_crash
Fix potential memory corruption with negative memmove() size
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 5f524d0..c2f504e 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1749,7 +1749,7 @@ LZ4_decompress_generic(
const size_t dictSize /* note : = 0 if noDict */
)
{
- if (src == NULL) { return -1; }
+ if ((src == NULL) || (outputSize < 0)) { return -1; }
{ const BYTE* ip = (const BYTE*) src;
const BYTE* const iend = ip + srcSize;