From d2a319a445e4ddf9ef547266e84948d638e1b6fd Mon Sep 17 00:00:00 2001 From: Jonas Özbay Date: Apr 12 2024 12:51:31 +0000 Subject: [PATCH 1/2] Correct the selection of alloc/free functions for zlib. (as in PR #21759 upstream) --- diff --git a/mono-6.12.0-correct-alloc-free-for-zlib.patch b/mono-6.12.0-correct-alloc-free-for-zlib.patch new file mode 100644 index 0000000..d9c3b25 --- /dev/null +++ b/mono-6.12.0-correct-alloc-free-for-zlib.patch @@ -0,0 +1,35 @@ +From ed68c250b8589663601aa7dd88177697d0b37ec9 Mon Sep 17 00:00:00 2001 +From: jo-oe <38652639+jo-oe@users.noreply.github.com> +Date: Tue, 9 Apr 2024 16:57:39 +0200 +Subject: [PATCH] Correct the selection of alloc/free functions for zlib. + +Avoids segfault when working with zlib-ng. +See: +https://github.com/zlib-ng/zlib-ng/issues/1708 +--- + support/zlib-helper.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/support/zlib-helper.c b/support/zlib-helper.c +index 76d8951ad8a8a..a5fbc0138822d 100644 +--- a/support/zlib-helper.c ++++ b/support/zlib-helper.c +@@ -76,6 +76,8 @@ CreateZStream (gint compress, guchar gzip, read_write_func func, void *gchandle) + return NULL; + + z = z_new0 (z_stream); ++ z->zalloc = z_alloc; ++ z->zfree = z_free; + if (compress) { + retval = deflateInit2 (z, Z_DEFAULT_COMPRESSION, Z_DEFLATED, gzip ? 31 : -15, 8, Z_DEFAULT_STRATEGY); + } else { +@@ -86,8 +88,6 @@ CreateZStream (gint compress, guchar gzip, read_write_func func, void *gchandle) + free (z); + return NULL; + } +- z->zalloc = z_alloc; +- z->zfree = z_free; + result = z_new0 (ZStream); + result->stream = z; + result->func = func; + From e18e346346ecc4e3d5bbf8a4e01f0aa613a09125 Mon Sep 17 00:00:00 2001 From: Jonas Özbay Date: Apr 12 2024 12:52:28 +0000 Subject: [PATCH 2/2] Correct the selection of alloc/free functions for zlib. (as in PR #21759 upstream) [2] --- diff --git a/mono.spec b/mono.spec index acd2bb4..18a781c 100644 --- a/mono.spec +++ b/mono.spec @@ -24,7 +24,7 @@ %global xamarinrelease 199 Name: mono Version: 6.12.0 -Release: 16%{?dist} +Release: 17%{?dist} Summary: Cross-platform, Open Source, .NET development framework License: MIT @@ -59,6 +59,7 @@ Patch12: 0001-Reenable-mdoc.exe-build.patch # fix issue with conflicts between i686 and x86_64 package (#1853724) Patch13: mono-6.6.0-fix-multi-arch-issue.patch Patch14: mono-configure-c99.patch +Patch15: mono-6.12.0-correct-alloc-free-for-zlib.patch BuildRequires: make BuildRequires: bison @@ -351,6 +352,7 @@ popd %patch -P 12 -p1 %patch -P 13 -p1 %patch -P 14 -p1 +%patch -P 15 -p1 # don't build mono-helix-client which requires the helix-binaries to build sed -i 's|mono-helix-client||g' mcs/tools/Makefile @@ -943,6 +945,9 @@ cert-sync --quiet /etc/pki/tls/certs/ca-bundle.crt %files complete %changelog +* Fri Apr 12 2024 Jonas Özbay - 6.12.0-17 +- Correct the selection of alloc/free functions for zlib. (as in PR #21759 upstream) + * Thu Jan 25 2024 Fedora Release Engineering - 6.12.0-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild