diff options
author | Ernestas Kulik <ernestask@gnome.org> | 2017-07-23 19:53:47 +0300 |
---|---|---|
committer | Ernestas Kulik <ernestask@gnome.org> | 2017-08-07 14:00:59 +0300 |
commit | e5d98fee7026a9304cc232402be09f8082e01b8f (patch) | |
tree | 9ba3cc4be71cee7e56df635d1e4ce9349b1850b9 | |
parent | 10e840d2231e21c8419dd01d5fbc652c72c51767 (diff) | |
download | nautilus-e5d98fee7026a9304cc232402be09f8082e01b8f.tar.gz |
window-slot: check location before constructing tab restore data
Assuming that the location cannot be null can leads to crashes in cases
when the user is trying to open non-existent locations, e.g. broken
bookmarks.
https://bugzilla.gnome.org/show_bug.cgi?id=785317
-rw-r--r-- | src/nautilus-window-slot.c | 5 | ||||
-rw-r--r-- | src/nautilus-window.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c index 39d62297f..1028d2b93 100644 --- a/src/nautilus-window-slot.c +++ b/src/nautilus-window-slot.c @@ -181,6 +181,11 @@ nautilus_window_slot_get_restore_tab_data (NautilusWindowSlot *self) priv = nautilus_window_slot_get_instance_private (self); + if (priv->location == NULL) + { + return NULL; + } + back_list = g_list_copy_deep (priv->back_list, (GCopyFunc) g_object_ref, NULL); diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 442dd0e8b..bdfc024a7 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -1620,7 +1620,10 @@ nautilus_window_slot_close (NautilusWindow *window, } data = nautilus_window_slot_get_restore_tab_data (slot); - g_queue_push_head (priv->tab_data_queue, data); + if (data != NULL) + { + g_queue_push_head (priv->tab_data_queue, data); + } close_slot (window, slot, TRUE); |