[gtk/gtk-4-2: 51/91] Fix a possible crash in gtk_show_uri
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-4-2: 51/91] Fix a possible crash in gtk_show_uri
- Date: Tue, 4 May 2021 02:05:41 +0000 (UTC)
commit 5783d8af91de67e534742392ec7a54f69987fdb9
Author: Matthias Clasen <mclasen redhat com>
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
gdk/x11/gdkapplaunchcontext-x11.c | 3 +++
1 file changed, 3 insertions(+)
---
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]