diff --git a/scl-utils-2.0.2-rhbz-1728450.patch b/scl-utils-2.0.2-rhbz-1728450.patch new file mode 100644 index 0000000..0013b0b --- /dev/null +++ b/scl-utils-2.0.2-rhbz-1728450.patch @@ -0,0 +1,54 @@ +From 3538686a21279c60c916e82ece02efcd88ae95b9 Mon Sep 17 00:00:00 2001 +From: Joe Orton +Date: Thu, 8 Aug 2019 09:26:00 +0100 +Subject: [PATCH] Fix crashes in "scl list-enabled": + +* src/lib_common.c (merge_string_arrays): + Ensure elements of returned array are strdup()ed. + +* src/scllib.c (get_enabled_collections): + Ensure all elements of returned array are strdup()ed. + +Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1728450 +--- + src/lib_common.c | 5 +++++ + src/scllib.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/lib_common.c b/src/lib_common.c +index 1aa49a0..2e7d116 100644 +--- a/src/lib_common.c ++++ b/src/lib_common.c +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + + #include "errors.h" + #include "scllib.h" +@@ -269,6 +270,10 @@ char **merge_string_arrays(char *const *array1, char *const *array2) + } + merged_array[++prev] = NULL; + ++ for (int i = 0; i < prev; i++) { ++ merged_array[i] = xstrdup(merged_array[i]); ++ } ++ + return merged_array; + } + +diff --git a/src/scllib.c b/src/scllib.c +index ce8df90..3c32d65 100644 +--- a/src/scllib.c ++++ b/src/scllib.c +@@ -107,8 +107,8 @@ scl_rc get_enabled_collections(char ***_enabled_collections) + sizeof(SCL_MODULES_PATH - 1))){ + + enabled_collections[i] += sizeof(SCL_MODULES_PATH); +- enabled_collections[i] = xstrdup(enabled_collections[i]); + } ++ enabled_collections[i] = xstrdup(enabled_collections[i]); + } + + } diff --git a/scl-utils.spec b/scl-utils.spec index c28be30..b271368 100644 --- a/scl-utils.spec +++ b/scl-utils.spec @@ -4,7 +4,7 @@ Name: scl-utils Epoch: 1 Version: 2.0.2 -Release: 15%{dist} +Release: 16%{dist} Summary: Utilities for alternative packaging License: GPLv2+ @@ -18,6 +18,9 @@ Requires: %{_bindir}/modulecmd Patch1: 0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch +# https://github.com/sclorg/scl-utils/pull/25 +Patch100: scl-utils-2.0.2-rhbz-1728450.patch + %description Run-time utility for alternative packaging. @@ -75,6 +78,9 @@ ln -s prefixes conf %{_rpmconfigdir}/brp-scl-python-bytecompile %changelog +* Wed Jul 29 2020 Vitaly Zaitsev - 1:2.0.2-16 +- Backported upstream patches to resolve RHBZ#1728450. + * Wed Jul 29 2020 Fedora Release Engineering - 1:2.0.2-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild