[gimp/gimp-2-10] Issue #3093 - Invalid characters in Open Location dialog crashes GIMP
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] Issue #3093 - Invalid characters in Open Location dialog crashes GIMP
- Date: Sat, 29 Jun 2019 11:18:35 +0000 (UTC)
commit 2909514ace2d0d32c13f34472d94d1bd67430a9c
Author: Michael Natterer <mitch gimp org>
Date: Sat Jun 29 13:14:14 2019 +0200
Issue #3093 - Invalid characters in Open Location dialog crashes GIMP
file_open_location_response(): guard against g_file_new_for_uri()
returning NULL (which it shouldn't) and an error being NULL (which it
shouldn't either for the same reason). Spotted by Massimo.
(cherry picked from commit cf8148df5e0eb91ada451d8aae9f35b0e832f138)
app/dialogs/file-open-location-dialog.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/app/dialogs/file-open-location-dialog.c b/app/dialogs/file-open-location-dialog.c
index 3d1a1a0c2b..dcdffc9056 100644
--- a/app/dialogs/file-open-location-dialog.c
+++ b/app/dialogs/file-open-location-dialog.c
@@ -198,6 +198,10 @@ file_open_location_response (GtkDialog *dialog,
{
GFile *entered_file = g_file_new_for_uri (text);
+ /* should not fail but does, see issue #3093 */
+ if (! entered_file)
+ entered_file = g_object_ref (file);
+
gtk_widget_show (box);
gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE);
@@ -237,7 +241,9 @@ file_open_location_response (GtkDialog *dialog,
{
gimp_message (gimp, G_OBJECT (box), GIMP_MESSAGE_ERROR,
_("Opening '%s' failed:\n\n%s"),
- text, error->message);
+ text,
+ /* error should never be NULL, also issue #3093 */
+ error ? error->message : _("Invalid URI"));
g_clear_error (&error);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]