[gtk+/gtk-3-18] gtkfilesystem: protect against null filesystem type
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-18] gtkfilesystem: protect against null filesystem type
- Date: Mon, 12 Oct 2015 17:27:05 +0000 (UTC)
commit c1b1e41ddbeb0a1e2f71648c3e0a2ac12cd9091d
Author: Carlos Soriano <csoriano gnome org>
Date: Thu Oct 8 01:19:19 2015 +0200
gtkfilesystem: protect against null filesystem type
The filesystem:type attribute could be NULL, then g_strv_contains
will crash if that happens.
Just don't call it if the attribute is not set.
gtk/gtkfilesystem.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilesystem.c b/gtk/gtkfilesystem.c
index 09601bd..a266194 100644
--- a/gtk/gtkfilesystem.c
+++ b/gtk/gtkfilesystem.c
@@ -947,7 +947,10 @@ _gtk_file_consider_as_remote (GFile *file)
const gchar *type;
type = g_file_info_get_attribute_string (info, "filesystem::type");
- is_remote = g_strv_contains (remote_types, type);
+ if (type != NULL)
+ is_remote = g_strv_contains (remote_types, type);
+ else
+ is_remote = FALSE;
g_object_unref (info);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]