From 2b40fb4fd975ccec15c271be4f379e690f2e37a0 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 12 Aug 2005 03:03:44 +0000 Subject: [PATCH] Work around some problems with the gnome-vfs backends which could lead to 2005-08-11 Matthias Clasen * gtk/gtkfilechooserdefault.c: Work around some problems with the gnome-vfs backends which could lead to crashes in the bookmark handling. (#310270, Diego Gonzalez, patch by Michael Meeks) --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ gtk/gtkfilechooserdefault.c | 8 ++++++-- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f46c74af0f..b6303313fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-08-11 Matthias Clasen + + * gtk/gtkfilechooserdefault.c: Work around some problems + with the gnome-vfs backends which could lead to crashes + in the bookmark handling. (#310270, Diego Gonzalez, patch + by Michael Meeks) + 2005-08-11 Kristian Rietveld Fix for #312924, by John Finlay. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f46c74af0f..b6303313fa 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2005-08-11 Matthias Clasen + + * gtk/gtkfilechooserdefault.c: Work around some problems + with the gnome-vfs backends which could lead to crashes + in the bookmark handling. (#310270, Diego Gonzalez, patch + by Michael Meeks) + 2005-08-11 Kristian Rietveld Fix for #312924, by John Finlay. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f46c74af0f..b6303313fa 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +2005-08-11 Matthias Clasen + + * gtk/gtkfilechooserdefault.c: Work around some problems + with the gnome-vfs backends which could lead to crashes + in the bookmark handling. (#310270, Diego Gonzalez, patch + by Michael Meeks) + 2005-08-11 Kristian Rietveld Fix for #312924, by John Finlay. diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 5d23161a0b..bd1b8c9fc8 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -1075,6 +1075,8 @@ change_folder_and_display_error (GtkFileChooserDefault *impl, gboolean result; GtkFilePath *path_copy; + g_return_val_if_fail (path != NULL, FALSE); + profile_start ("start", (char *) path); /* We copy the path because of this case: @@ -2060,8 +2062,8 @@ shortcut_find_position (GtkFileChooserDefault *impl, volume = col_data; base_path = gtk_file_system_volume_get_base_path (impl->file_system, volume); - exists = strcmp (gtk_file_path_get_string (path), - gtk_file_path_get_string (base_path)) == 0; + exists = base_path && strcmp (gtk_file_path_get_string (path), + gtk_file_path_get_string (base_path)) == 0; g_free (base_path); if (exists) @@ -2092,6 +2094,8 @@ shortcuts_add_bookmark_from_path (GtkFileChooserDefault *impl, { GError *error; + g_return_val_if_fail (path != NULL, FALSE); + if (shortcut_find_position (impl, path) != -1) return FALSE;