mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-06 00:48:18 -07:00
app-arch/lz4: Backport memory corruption fix (CVE-2021-3520)
Bug: https://bugs.gentoo.org/791952 Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
22
app-arch/lz4/files/lz4-1.9.3-negative-memmove.patch
Normal file
22
app-arch/lz4/files/lz4-1.9.3-negative-memmove.patch
Normal 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;
|
||||
@@ -18,6 +18,10 @@ IUSE="static-libs"
|
||||
|
||||
CMAKE_USE_DIR=${S}/build/cmake
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${P}-negative-memmove.patch
|
||||
)
|
||||
|
||||
multilib_src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DBUILD_STATIC_LIBS=$(usex static-libs)
|
||||
Reference in New Issue
Block a user