1From 8301a21773ef61656225e264f4f06ae14462bca7 Mon Sep 17 00:00:00 2001 2From: Jasper Lievisse Adriaanse <j@jasper.la> 3Date: Fri, 26 Feb 2021 15:21:20 +0100 4Subject: [PATCH] Fix potential memory corruption with negative memmove() size 5 6Signed-off-by: Peter Korsgaard <peter@korsgaard.com> 7--- 8 lib/lz4.c | 2 +- 9 1 file changed, 1 insertion(+), 1 deletion(-) 10 11diff --git a/lib/lz4.c b/lib/lz4.c 12index 5f524d0..c2f504e 100644 13--- a/lib/lz4.c 14+++ b/lib/lz4.c 15@@ -1749,7 +1749,7 @@ LZ4_decompress_generic( 16 const size_t dictSize /* note : = 0 if noDict */ 17 ) 18 { 19- if (src == NULL) { return -1; } 20+ if ((src == NULL) || (outputSize < 0)) { return -1; } 21 22 { const BYTE* ip = (const BYTE*) src; 23 const BYTE* const iend = ip + srcSize; 24-- 252.20.1 26 27