From 14c996a4928960834c08b6abb3538e9ac9a42a99 Mon Sep 17 00:00:00 2001 From: yanshuai01 Date: Sat, 11 May 2024 10:48:00 +0800 Subject: [PATCH] fix crash if image creation has errors --- ...x-crash-if-image-creation-has-errors.patch | 40 +++++++++++++++++++ gnome-disk-utility.spec | 6 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 0002-fix-crash-if-image-creation-has-errors.patch diff --git a/0002-fix-crash-if-image-creation-has-errors.patch b/0002-fix-crash-if-image-creation-has-errors.patch new file mode 100644 index 0000000..6883a3e --- /dev/null +++ b/0002-fix-crash-if-image-creation-has-errors.patch @@ -0,0 +1,40 @@ +From 20f55290ca0f97925935467e8ddc8f80e19ec5ab Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Wed, 29 Nov 2023 17:44:54 +0100 +Subject: [PATCH] creatediskimage: Fix crash if image creation has errors + +The change to use the dialogue "response" signal made the code release +the last reference to the DialogData before the user could answer, and +when they did, we would crash trying to access it. + +Fixes: 6ef5a055debd ("creatediskimage: Use dialog response signal") +Closes: #319 + +--- + src/disks/gducreatediskimagedialog.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/disks/gducreatediskimagedialog.c b/src/disks/gducreatediskimagedialog.c +index 5f64c81..5d5a4d9 100644 +--- a/src/disks/gducreatediskimagedialog.c ++++ b/src/disks/gducreatediskimagedialog.c +@@ -466,6 +466,7 @@ on_response (GtkDialog *dialog, + g_clear_error (&error); + } + } ++ dialog_data_unref (data); + } + + static gboolean +@@ -514,7 +515,7 @@ on_success (gpointer user_data) + GTK_RESPONSE_NO); + gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Close"), GTK_RESPONSE_CLOSE); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE); +- g_signal_connect (dialog, "response", G_CALLBACK (on_response), data); ++ g_signal_connect (dialog, "response", G_CALLBACK (on_response), dialog_data_ref (data)); + g_free (s); + + gtk_window_present (GTK_WINDOW (dialog)); +-- +2.27.0 + diff --git a/gnome-disk-utility.spec b/gnome-disk-utility.spec index 17b1a8a..34600c8 100644 --- a/gnome-disk-utility.spec +++ b/gnome-disk-utility.spec @@ -2,7 +2,7 @@ Name: gnome-disk-utility Version: 44.0 -Release: 1 +Release: 2 Summary: Libraries and applications for dealing with storage devices License: GPLv2+ URL: https://gitlab.gnome.org/GNOME/gnome-disk-utility @@ -19,6 +19,7 @@ Requires: udisks2 Requires: libhandy%{?_isa} >= %{libhandy_version} Patch1: 0001-fix-disks-Fixed-interface-translation-not-displayed.patch +Patch2: 0002-fix-crash-if-image-creation-has-errors.patch %description This gnome-disk-utility repository provides libraries and applications for @@ -58,6 +59,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_mandir}/man1/* %changelog +* Sat May 11 2024 yanshuai - 44.0-2 +- creatediskimage: Fix crash if image creation has errors + * Thu Nov 23 2023 lwg - 44.0-1 - update to version 44.0