summaryrefslogtreecommitdiff
path: root/gtk/gtkfilesystem.c
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-10-08 01:19:19 +0200
committerCarlos Soriano <csoriano@gnome.org>2015-10-08 01:21:28 +0200
commitc929e98fba2547015771ffb06c92618ecfe22c71 (patch)
tree038c7ad64ff497f61b45370205d28a26461db654 /gtk/gtkfilesystem.c
parentf10c0da36c27922bebb0f55aa876f215e4840c8e (diff)
downloadgtk+-c929e98fba2547015771ffb06c92618ecfe22c71.tar.gz
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.
Diffstat (limited to 'gtk/gtkfilesystem.c')
-rw-r--r--gtk/gtkfilesystem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkfilesystem.c b/gtk/gtkfilesystem.c
index 09601bd261..a26619443b 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);
}