Skip to content

Commit

Permalink
Fix a bug occuring when using certain actions on a collection
Browse files Browse the repository at this point in the history
item which is not in the selection.
Triggering it will either result in an assertion failure or a
segfault.

To reproduce:
- open a collection
- right-click on a non-selected image
- select Delete... menu entry (or Copy, Move, Rename, Properties...)

It results in the best case:
** ERROR **: file filelist.c: line 905 (file_data_ref): assertion failed: (fd->magick == 0x12345678)
or a pure segfault due to corrupted data.

collection_table_popup_file_list() has to return a list of filedata *
not a list of gchar *.
  • Loading branch information
Laurent Monin committed May 3, 2008
1 parent 31ba226 commit e01df05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/collect-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ static GList *collection_table_popup_file_list(CollectTable *ct)
return collection_table_selection_get_list(ct);
}

return g_list_append(NULL, g_strdup(ct->click_info->fd->path));
return g_list_append(NULL, file_data_ref(ct->click_info->fd));
}

static void collection_table_popup_edit_cb(GtkWidget *widget, gpointer data)
Expand Down

0 comments on commit e01df05

Please sign in to comment.