[gtk/gtk-4-2: 77/91] gtkplacessidebar.c: add bookmark null checking
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-4-2: 77/91] gtkplacessidebar.c: add bookmark null checking
- Date: Tue, 4 May 2021 02:05:42 +0000 (UTC)
commit 2d747cca3c805a7530c5b5bc0954a48116d8ee58
Author: Geyslan G. Bem <geyslan gmail com>
Date: Tue Apr 27 11:42:55 2021 -0300
gtkplacessidebar.c: add bookmark null checking
This fixes nautilus crash and perhaps other callers issues.
Nautilus (and sometimes glib) crashes with malformed URI inside of the
bookmarks file .config/gtk-3.0/bookmarks when it has no LABEL.
This is result from the closed glib MR #2065 analysis and agreement.
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2065#note_1091979
Signed-off-by: Geyslan G. Bem <geyslan gmail com>
gtk/gtkplacessidebar.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 43f03069d8..c57031be07 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -795,6 +795,10 @@ on_bookmark_query_info_complete (GObject *source,
{
/* Don't add non-UTF-8 bookmarks */
bookmark_name = g_file_get_basename (root);
+ if (bookmark_name == NULL)
+ {
+ goto out;
+ }
if (!g_utf8_validate (bookmark_name, -1, NULL))
{
g_free (bookmark_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]