Apply a patch that fixes rhbz#2307237

Resolves: rhbz#2307237
This commit is contained in:
Tulio Magno Quites Machado Filho 2024-09-10 15:26:39 -03:00
commit 8a46722e37
2 changed files with 33 additions and 1 deletions

26
1773.patch Normal file
View file

@ -0,0 +1,26 @@
From af013cf65867e3589f6da714eefc69d9f986bb91 Mon Sep 17 00:00:00 2001
From: Nathan Moinvaziri <nathan@nathanm.com>
Date: Mon, 9 Sep 2024 13:32:33 -0700
Subject: [PATCH] Don't use chunkunroll for inflateBack
If the output buffer and the window buffer are the same
memory allocation, we cannot make the assumptions that chunkunroll
does, that it is okay to overwrite the output buffer.
---
inffast_tpl.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/inffast_tpl.h b/inffast_tpl.h
index 9ddd187d84..c8f4786754 100644
--- a/inffast_tpl.h
+++ b/inffast_tpl.h
@@ -249,7 +249,8 @@ void Z_INTERNAL INFLATE_FAST(PREFIX3(stream) *strm, uint32_t start) {
if (op < len) { /* still need some from output */
len -= op;
out = chunkcopy_safe(out, from, op, safe);
- out = CHUNKUNROLL(out, &dist, &len);
+ if (!extra_safe)
+ out = CHUNKUNROLL(out, &dist, &len);
out = chunkcopy_safe(out, out - dist, len, safe);
} else {
out = chunkcopy_safe(out, from, len, safe);

View file

@ -19,13 +19,16 @@
Name: zlib-ng
Version: 2.1.7
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Zlib replacement with optimizations
License: Zlib
Url: https://github.com/zlib-ng/zlib-ng
Source0: https://github.com/zlib-ng/zlib-ng/archive/%{version}/%{name}-%{version}.tar.gz
Patch: far.diff
# Backport from https://github.com/zlib-ng/zlib-ng/pull/1773
# Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2307237
Patch: 1773.patch
BuildRequires: cmake >= 3.1
BuildRequires: gcc-c++
@ -215,6 +218,9 @@ CHOST=%{target_cpu}-%{cpu_vendor}-linux-gnu sh test/abicheck.sh --zlib-compat
%changelog
* Tue Sep 10 2024 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.7-3
- Fixes rhbz#2307237
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild