summaryrefslogtreecommitdiff
path: root/src/nautilus-shell-search-provider.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-09-25 14:36:32 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-09-25 14:36:32 -0400
commit7427ee626e32d8bbe7d607c96a25f686b64df365 (patch)
treec40d74cfcd1278de61d2fefd2fec7780c8cc68f7 /src/nautilus-shell-search-provider.c
parent32edfac1d27c49b9dd75a0a56fb7cccaabd8adc1 (diff)
downloadnautilus-7427ee626e32d8bbe7d607c96a25f686b64df365.tar.gz
shell-search-provider: warn against NULL strings before normalizing
Since g_mount_get_name() and nautilus_bookmark_get_name() can possibly return NULL, warn against it before normalizing the string and trying to compare it with the search terms. This fixes a crasher in the shell search provider. https://bugzilla.gnome.org/show_bug.cgi?id=684807
Diffstat (limited to 'src/nautilus-shell-search-provider.c')
-rw-r--r--src/nautilus-shell-search-provider.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c
index 552a30fa6..6d4291e8a 100644
--- a/src/nautilus-shell-search-provider.c
+++ b/src/nautilus-shell-search-provider.c
@@ -315,6 +315,9 @@ search_add_volumes_and_bookmarks (NautilusShellSearchProviderApp *self)
bookmark = nautilus_bookmark_list_item_at (self->bookmarks, idx);
name = nautilus_bookmark_get_name (bookmark);
+ if (name == NULL)
+ continue;
+
prepared = prepare_string_for_compare (name);
found = TRUE;
@@ -393,6 +396,9 @@ search_add_volumes_and_bookmarks (NautilusShellSearchProviderApp *self)
mount = l->data;
query_text = g_mount_get_name (mount);
+ if (query_text == NULL)
+ continue;
+
prepared = prepare_string_for_compare (query_text);
g_free (query_text);