From b4b58f54b640165ef82dcabeb8d70fb4ade475f0 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 24 Sep 2013 18:46:53 -0500 Subject: [PATCH 1/2] filemanager: Add assertion checks to prevent dereferencing ptrs * clang static analysis shows gaps where these calls could rereferencce pointers. Perform an assertion check. --- plugins/filebrowser/pluma-file-browser-store.c | 2 ++ plugins/filebrowser/pluma-file-browser-widget.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/filebrowser/pluma-file-browser-store.c b/plugins/filebrowser/pluma-file-browser-store.c index 6f61110..ba45fef 100644 --- a/plugins/filebrowser/pluma-file-browser-store.c +++ b/plugins/filebrowser/pluma-file-browser-store.c @@ -2480,6 +2480,8 @@ set_virtual_root_from_node (PlumaFileBrowserStore * model, GSList *copy; GtkTreePath *empty = NULL; + g_assert (node != NULL); + prev = node; next = prev->parent; diff --git a/plugins/filebrowser/pluma-file-browser-widget.c b/plugins/filebrowser/pluma-file-browser-widget.c index f2c54fe..22c3c3b 100644 --- a/plugins/filebrowser/pluma-file-browser-widget.c +++ b/plugins/filebrowser/pluma-file-browser-widget.c @@ -1640,6 +1640,8 @@ jump_to_location (PlumaFileBrowserWidget * obj, GList * item, obj->priv->changing_location = TRUE; + g_assert (obj->priv->current_location != NULL); + loc = (Location *) (obj->priv->current_location->data); /* Set the new root + virtual root */ From 66585e2be5a1cd936abb27db318deba4bfc4a453 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 24 Sep 2013 19:59:06 -0500 Subject: [PATCH 2/2] filemanager: Add missing data assignment * Amanas mentioned in IRC that it was likely missed after the gsettings migration. --- plugins/filebrowser/pluma-file-browser-plugin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/filebrowser/pluma-file-browser-plugin.c b/plugins/filebrowser/pluma-file-browser-plugin.c index bce64c6..69b1e18 100644 --- a/plugins/filebrowser/pluma-file-browser-plugin.c +++ b/plugins/filebrowser/pluma-file-browser-plugin.c @@ -306,6 +306,7 @@ on_confirm_trash_changed (GSettings *settings, PlumaFileBrowserPluginData *data; gboolean enable = FALSE; + data = (PlumaFileBrowserPluginData *)(user_data); enable = g_settings_get_boolean (settings, key); data->confirm_trash = enable;