summaryrefslogtreecommitdiff
path: root/system/lz4/CVE-2021-3520.patch
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2022-04-25 15:57:18 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2022-05-01 17:06:42 -0500
commitd505b70a4b404d526d43a2da7bbd5cc3653e8294 (patch)
tree5a29cda96e6b80b3338660d55ced3f76536a7e5d /system/lz4/CVE-2021-3520.patch
parentdb78f87a0f47ba0362c30e510c3bc585bacfaf8b (diff)
downloadpackages-d505b70a4b404d526d43a2da7bbd5cc3653e8294.tar.gz
packages-d505b70a4b404d526d43a2da7bbd5cc3653e8294.tar.bz2
packages-d505b70a4b404d526d43a2da7bbd5cc3653e8294.tar.xz
packages-d505b70a4b404d526d43a2da7bbd5cc3653e8294.zip
system/lz4: add patch for CVE-2021-3520. fixes #597.
Diffstat (limited to 'system/lz4/CVE-2021-3520.patch')
-rw-r--r--system/lz4/CVE-2021-3520.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/system/lz4/CVE-2021-3520.patch b/system/lz4/CVE-2021-3520.patch
new file mode 100644
index 000000000..053958dfe
--- /dev/null
+++ b/system/lz4/CVE-2021-3520.patch
@@ -0,0 +1,22 @@
+From 8301a21773ef61656225e264f4f06ae14462bca7 Mon Sep 17 00:00:00 2001
+From: Jasper Lievisse Adriaanse <j@jasper.la>
+Date: Fri, 26 Feb 2021 15:21:20 +0100
+Subject: [PATCH] Fix potential memory corruption with negative memmove() size
+
+---
+ lib/lz4.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/lz4.c b/lib/lz4.c
+index 5f524d01d..c2f504ef3 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;