[nautilus] directory: protect against null filesystem type
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] directory: protect against null filesystem type
- Date: Wed, 7 Oct 2015 23:35:24 +0000 (UTC)
commit 745652a9f30815f3b8563bfad4c26395b8410064
Author: Carlos Soriano <csoriano gnome org>
Date: Thu Oct 8 01:27:24 2015 +0200
directory: 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.
libnautilus-private/nautilus-directory.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c
index dc95998..29a35f9 100644
--- a/libnautilus-private/nautilus-directory.c
+++ b/libnautilus-private/nautilus-directory.c
@@ -639,7 +639,10 @@ nautilus_directory_is_remote (NautilusDirectory *directory)
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);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]