GNOME Bugzilla – Bug 314586
Don't stomp over memory
Last modified: 2005-08-26 16:02:45 UTC
Please describe the problem: This took me more than a day to track down. the gnome-vfs backend passes a GtkFileFolderGnomeVFS struct instead of the intended closure to a g_hash_table_foreach() call, with the expected bad consequences. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Index: gtkfilesystemgnomevfs.c =================================================================== RCS file: /cvs/gnome/libgnomeui/file-chooser/gtkfilesystemgnomevfs.c,v retrieving revision 1.70 diff -u -r1.70 gtkfilesystemgnomevfs.c --- gtkfilesystemgnomevfs.c 19 Aug 2005 18:47:01 -0000 1.70 +++ gtkfilesystemgnomevfs.c 26 Aug 2005 15:25:22 -0000 @@ -2767,7 +2797,7 @@ struct purge_closure closure; closure.removed_uris = NULL; - g_hash_table_foreach_steal (folder_vfs->children, purge_fn, folder_vfs); + g_hash_table_foreach_steal (folder_vfs->children, purge_fn, &closure); if (closure.removed_uris) {
(I would have attached the patch, but I kept running into file chooser crashes...)
Oh my, that's horrible :) Please go ahead and commit it. Thanks for taking the time to find it!
2005-08-26 Matthias Clasen <mclasen@redhat.com> * file-chooser/gtkfilesystemgnomevfs.c (folder_purge_and_unmark): Pass the address of the closure struct to the g_hash_table_foreach_steal() call. (#314586)