!6 fix CVE-2021-3520

From: @tong_1001
Reviewed-by: @overweight
Signed-off-by: @overweight
This commit is contained in:
openeuler-ci-bot 2021-06-21 02:32:04 +00:00 committed by Gitee
commit c0a12e2011
2 changed files with 28 additions and 2 deletions

View File

@ -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;

View File

@ -1,12 +1,13 @@
Name: lz4
Version: 1.9.3
Release: 1
Release: 2
Summary: Extremely fast compression algorithm
License: GPLv2+ and BSD
URL: https://lz4.github.io/lz4/
Source0: https://github.com/lz4/lz4/archive/v%{version}/%{name}-%{version}.tar.gz
Patch6000: Fix-Data-Corruption-Bug-when-Streaming-with-an-Attac.patch
Patch6000: Fix-Data-Corruption-Bug-when-Streaming-with-an-Attac.patch
Patch6001: backport-CVE-2021-3520.patch
Provides: %{name}-libs = %{version}-%{release}
Obsoletes: %{name} < 1.7.5-3
@ -68,6 +69,9 @@ export MOREFLAGS="-g"
%{_mandir}/man1/unlz4.1*
%changelog
* Sat Jun 19 2021 shixuantong <shixuantong@huawei.com> - 1.9.3-2
- fix CVE-2021-3520
* Thu Jan 28 2021 liudabo <liudabo1@huawei.com> - 1.9.3-1
- upgrade version to 1.9.3