public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/libsoup3] rawhide: Fix test failures on aarch64
@ 2026-06-24  7:35 Ondrej Holy
  0 siblings, 0 replies; only message in thread
From: Ondrej Holy @ 2026-06-24  7:35 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/libsoup3
            Branch : rawhide
            Commit : 9fbcdc520f709dba85a705c4ebfa1cc0ce08f6a9
            Author : Ondrej Holy <oholy@redhat.com>
            Date   : 2026-06-24T08:28:23+02:00
            Stats  : +84/-0 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/libsoup3/c/9fbcdc520f709dba85a705c4ebfa1cc0ce08f6a9?branch=rawhide

            Log:
            Fix test failures on aarch64

Backport of https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/538
that fixes buffer overread in soup-body-input-stream and multipart test
cleanup to deal with test failures on aarch64.

---
diff --git a/libsoup3.spec b/libsoup3.spec
index 0ebb93e..64d77df 100644
--- a/libsoup3.spec
+++ b/libsoup3.spec
@@ -21,6 +21,11 @@ Patch:   no-ntlm-in-fips-mode.patch
 # https://gitlab.gnome.org/GNOME/libsoup/-/work_items/530
 Patch:   skip-logger-test-on-32bit.patch
 
+# Fix test failures on aarch64
+# https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/538
+Patch:   soup-body-input-stream-limit-buffer-read-to-the-received-content.patch
+Patch:   multipart-test-close-base-stream-and-unref-multipart-before-quitting-main-loop.patch
+
 BuildRequires: gcc
 BuildRequires: gettext
 BuildRequires: glib-networking >= %{glib2_version}

diff --git a/multipart-test-close-base-stream-and-unref-multipart-before-quitting-main-loop.patch b/multipart-test-close-base-stream-and-unref-multipart-before-quitting-main-loop.patch
new file mode 100644
index 0000000..fb206d1
--- /dev/null
+++ b/multipart-test-close-base-stream-and-unref-multipart-before-quitting-main-loop.patch
@@ -0,0 +1,50 @@
+From 19b81b655f309026e5c76ddc18aee687f14636e4 Mon Sep 17 00:00:00 2001
+From: Milan Crha <mcrha@redhat.com>
+Date: Tue, 23 Jun 2026 08:47:51 +0200
+Subject: [PATCH] multipart-test: Close base stream and unref multipart before
+ quitting main loop
+
+It could happen that the main loop was quit with some pending GSource,
+which prevents free of the session, which causes the test failure. Ensure
+the main context does not have the leftover GSource by closing the base
+stream and by freeing the multipart object before quitting the main loop.
+
+Assisted-by: Claude Opus 4.6
+---
+ tests/multipart-test.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/tests/multipart-test.c b/tests/multipart-test.c
+index 3d85e22..3842943 100644
+--- a/tests/multipart-test.c
++++ b/tests/multipart-test.c
+@@ -310,6 +310,7 @@ multipart_next_part_cb (GObject *source, GAsyncResult *res, gpointer data)
+ 	g_assert_no_error (error);
+ 	if (error) {
+ 		g_clear_error (&error);
++		g_input_stream_close (G_FILTER_INPUT_STREAM (multipart)->base_stream, NULL, NULL);
+ 		g_object_unref (multipart);
+ 		g_main_loop_quit (loop);
+ 		return;
+@@ -317,6 +318,7 @@ multipart_next_part_cb (GObject *source, GAsyncResult *res, gpointer data)
+
+ 	if (!in) {
+ 		g_assert_cmpint (passes, ==, 4);
++		g_input_stream_close (G_FILTER_INPUT_STREAM (multipart)->base_stream, NULL, NULL);
+ 		g_object_unref (multipart);
+ 		g_main_loop_quit (loop);
+ 		return;
+@@ -408,8 +410,10 @@ sync_multipart_handling_cb (GObject *source, GAsyncResult *res, gpointer data)
+
+ 	g_assert_cmpint (passes, ==, 4);
+
+-	g_main_loop_quit (loop);
++	g_input_stream_close (G_FILTER_INPUT_STREAM (multipart)->base_stream, NULL, NULL);
+ 	g_object_unref (multipart);
++
++	g_main_loop_quit (loop);
+ }
+
+ static void
+--
+2.54.0

diff --git a/soup-body-input-stream-limit-buffer-read-to-the-received-content.patch b/soup-body-input-stream-limit-buffer-read-to-the-received-content.patch
new file mode 100644
index 0000000..c599248
--- /dev/null
+++ b/soup-body-input-stream-limit-buffer-read-to-the-received-content.patch
@@ -0,0 +1,29 @@
+From 72e566d82363ba35cdcf4a8c7b4826029f7190ff Mon Sep 17 00:00:00 2001
+From: Milan Crha <mcrha@redhat.com>
+Date: Tue, 23 Jun 2026 08:44:02 +0200
+Subject: [PATCH] soup-body-input-stream: Limit buffer read to the received
+ content
+
+The strstr() could read after the read content in the buffer, where it
+could garbage data not belonging to the buffer.
+
+Assisted-by: Claude Opus 4.6
+---
+ libsoup/http1/soup-body-input-stream.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libsoup/http1/soup-body-input-stream.c b/libsoup/http1/soup-body-input-stream.c
+index 6dd0809..ba84d00 100644
+--- a/libsoup/http1/soup-body-input-stream.c
++++ b/libsoup/http1/soup-body-input-stream.c
+@@ -198,7 +198,7 @@ again:
+ 		}
+
+                 /* ignore extensions */
+-                boundary = strstr (metabuf, ";");
++                boundary = memchr (metabuf, ';', nread);
+                 if (boundary)
+                         *boundary = '\0';
+                 else
+--
+2.54.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-24  7:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-24  7:35 [rpms/libsoup3] rawhide: Fix test failures on aarch64 Ondrej Holy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox