diff --git a/fix-CVE-2025-46420.patch b/fix-CVE-2025-46420.patch new file mode 100644 index 0000000000000000000000000000000000000000..19a45059f0fa58c22349924ac8105360cb17d038 --- /dev/null +++ b/fix-CVE-2025-46420.patch @@ -0,0 +1,56 @@ +From c9083869ec2a3037e6df4bd86b45c419ba295f8e Mon Sep 17 00:00:00 2001 +From: Patrick Griffis +Date: Thu, 26 Dec 2024 18:31:42 -0600 +Subject: [PATCH] soup_header_parse_quality_list: Fix leak + +When iterating over the parsed list we now steal the allocated strings that we want and then free_full the list which may contain remaining strings. +--- + libsoup/soup-headers.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/libsoup/soup-headers.c b/libsoup/soup-headers.c +index a5f7a7f6..85385cea 100644 +--- a/libsoup/soup-headers.c ++++ b/libsoup/soup-headers.c +@@ -530,7 +530,7 @@ soup_header_parse_quality_list (const char *header, GSList **unacceptable) + GSList *unsorted; + QualityItem *array; + GSList *sorted, *iter; +- char *item, *semi; ++ char *semi; + const char *param, *equal, *value; + double qval; + int n; +@@ -543,9 +543,8 @@ soup_header_parse_quality_list (const char *header, GSList **unacceptable) + unsorted = soup_header_parse_list (header); + array = g_new0 (QualityItem, g_slist_length (unsorted)); + for (iter = unsorted, n = 0; iter; iter = iter->next) { +- item = iter->data; + qval = 1.0; +- for (semi = strchr (item, ';'); semi; semi = strchr (semi + 1, ';')) { ++ for (semi = strchr (iter->data, ';'); semi; semi = strchr (semi + 1, ';')) { + param = skip_lws (semi + 1); + if (*param != 'q') + continue; +@@ -577,15 +576,15 @@ soup_header_parse_quality_list (const char *header, GSList **unacceptable) + if (qval == 0.0) { + if (unacceptable) { + *unacceptable = g_slist_prepend (*unacceptable, +- item); ++ g_steal_pointer (&iter->data)); + } + } else { +- array[n].item = item; ++ array[n].item = g_steal_pointer (&iter->data); + array[n].qval = qval; + n++; + } + } +- g_slist_free (unsorted); ++ g_slist_free_full (unsorted, g_free); + + qsort (array, n, sizeof (QualityItem), sort_by_qval); + sorted = NULL; +-- +2.39.3 + diff --git a/libsoup.spec b/libsoup.spec index 0aba4fac5a63c973faea5167a69ade7661c65e86..f06d8cc39df4409d424ce4443163eca61129423f 100644 --- a/libsoup.spec +++ b/libsoup.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 3 %define glib2_version 2.58 %{!?with_docs: %global with_docs 1} @@ -11,6 +11,7 @@ Summary: Soup, an HTTP library implementation License: LGPLv2 URL: https://wiki.gnome.org/Projects/libsoup Source0: https://download.gnome.org/sources/%{name}/2.74/%{name}-%{version}.tar.xz +Patch1: fix-CVE-2025-46420.patch BuildRequires: gettext BuildRequires: glib-networking @@ -120,6 +121,12 @@ This package contains developer documentation for %{name}. %endif %changelog +* Tue May 13 2025 yangjinlin01 - 2.74.3-3 +- fix CVE-2025-46420 + +* Mon Dec 09 2024 mgb01105731 - 2.74.3-2 +- Rebuild for remove inappropriate build dependencies. + * Thu Nov 24 2022 Funda Wang - 2.74.3-1 - New version 2.74.3