371706
From 8301a21773ef61656225e264f4f06ae14462bca7 Mon Sep 17 00:00:00 2001
371706
From: Jasper Lievisse Adriaanse <j@jasper.la>
371706
Date: Fri, 26 Feb 2021 15:21:20 +0100
371706
Subject: [PATCH] Fix potential memory corruption with negative memmove() size
371706
371706
---
371706
 lib/lz4.c | 2 +-
371706
 1 file changed, 1 insertion(+), 1 deletion(-)
371706
371706
diff --git a/lib/lz4.c b/lib/lz4.c
371706
index 5f524d01..c2f504ef 100644
371706
--- a/lib/lz4.c
371706
+++ b/lib/lz4.c
371706
@@ -1749,7 +1749,7 @@ LZ4_decompress_generic(
371706
                  const size_t dictSize         /* note : = 0 if noDict */
371706
                  )
371706
 {
371706
-    if (src == NULL) { return -1; }
371706
+    if ((src == NULL) || (outputSize < 0)) { return -1; }
371706
 
371706
     {   const BYTE* ip = (const BYTE*) src;
371706
         const BYTE* const iend = ip + srcSize;