mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-04 02:31:27 +00:00
libsoup-2.4: fix CVE-2025-46420
Refer: https://gitlab.gnome.org/GNOME/libsoup/-/issues/438 Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -0,0 +1,61 @@
|
|||||||
|
From 81e03c538d6a102406114567f4f1c468033ce2e4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Patrick Griffis <pgriffis@igalia.com>
|
||||||
|
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.
|
||||||
|
|
||||||
|
CVE: CVE-2025-46420
|
||||||
|
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/421/diffs?commit_id=c9083869ec2a3037e6df4bd86b45c419ba295f8e]
|
||||||
|
|
||||||
|
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||||
|
---
|
||||||
|
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 87bb3dc..9707ca0 100644
|
||||||
|
--- a/libsoup/soup-headers.c
|
||||||
|
+++ b/libsoup/soup-headers.c
|
||||||
|
@@ -528,7 +528,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;
|
||||||
|
@@ -541,9 +541,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;
|
||||||
|
@@ -575,15 +574,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.34.1
|
||||||
|
|
||||||
@@ -24,6 +24,7 @@ SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \
|
|||||||
file://CVE-2024-52530.patch \
|
file://CVE-2024-52530.patch \
|
||||||
file://CVE-2025-32906.patch \
|
file://CVE-2025-32906.patch \
|
||||||
file://CVE-2025-32914.patch \
|
file://CVE-2025-32914.patch \
|
||||||
|
file://CVE-2025-46420.patch \
|
||||||
"
|
"
|
||||||
SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13"
|
SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user