summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-04-19 16:39:53 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-04-19 16:52:55 -0400
commit536da7a15c1737bc63c8ecba5ccac40cc2170860 (patch)
tree9341e742f95dd35b315c4b17864da343913be2a7
parent610f52b125235bfa419686de95a5684fe91edf08 (diff)
downloadgtk+-fix-uri-crash-3.tar.gz
Fix a possible crash in gtk_show_urifix-uri-crash-3
g_file_get_basename can return NULL. Deal with it somehow. Fixes: #3883
-rw-r--r--gdk/x11/gdkapplaunchcontext-x11.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c
index 8051229ba5..2341bb2e1f 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;