diff --git a/gtk3-prevent-g_file_get_basename-return-NULL.patch b/gtk3-prevent-g_file_get_basename-return-NULL.patch new file mode 100644 index 0000000..e4329e1 --- /dev/null +++ b/gtk3-prevent-g_file_get_basename-return-NULL.patch @@ -0,0 +1,25 @@ +commit ce2a433ca157b444b54646aa0383ff5b75cc41f9 +Author: Matthias Clasen +Date: Mon Apr 19 16:39:53 2021 -0400 + + Fix a possible crash in gtk_show_uri + + g_file_get_basename can return NULL. + Deal with it somehow. + + Fixes: #3883 + +diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c +index 206c34e52d..43c190e5e6 100644 +--- a/gdk/x11/gdkapplaunchcontext-x11.c ++++ b/gdk/x11/gdkapplaunchcontext-x11.c +@@ -45,6 +45,9 @@ get_display_name (GFile *file, + if (name == NULL) + { + name = g_file_get_basename (file); ++ if (name == NULL) ++ name = g_file_get_uri (file); ++ + if (!g_utf8_validate (name, -1, NULL)) + { + tmp = name; diff --git a/gtk3.changes b/gtk3.changes index 600f128..21d151c 100644 --- a/gtk3.changes +++ b/gtk3.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Apr 21 12:29:38 UTC 2021 - QK ZHU + +- Add gtk3-prevent-g_file_get_basename-return-NULL.patch: + + Fix a possible crash in gtk_show_uri + (boo#1185082, glgo#GNOME/gtk!3458). + ------------------------------------------------------------------- Wed Mar 17 12:58:38 UTC 2021 - Dominique Leuenberger diff --git a/gtk3.spec b/gtk3.spec index 38a1d4a..67fcf37 100644 --- a/gtk3.spec +++ b/gtk3.spec @@ -50,6 +50,8 @@ Source99: baselibs.conf Patch0: gtk3-GTK_PATH64.patch # PATCH-FIX-OPENSUSE gtk3-revert-forced-xftdpi.patch fvogt@opensuse.org -- Revert very controversal commit on GTK3, forcing DPI to 96 Patch1: gtk3-revert-forced-xftdpi.patch +# PATCH-FIX-UPSTREAM gtk3-prevent-g_file_get_basename-return-NULL.patch boo#1185082, glgo#GNOME/gtk!3458 qkzhu@suse.com -- Fix a possible crash in gtk_show_uri +Patch2: gtk3-prevent-g_file_get_basename-return-NULL.patch BuildRequires: cups-devel >= 1.7 BuildRequires: docbook-xsl-stylesheets @@ -398,6 +400,7 @@ cp -a %{SOURCE1} . %patch0 -p1 %endif %patch1 -p1 +%patch2 -p1 %build NOCONFIGURE=1 ./autogen.sh