After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 314586 - Don't stomp over memory
Don't stomp over memory
Status: RESOLVED FIXED
Product: libgnomeui
Classification: Deprecated
Component: file-chooser
2.11.x
Other All
: Normal critical
: future
Assigned To: Alexander Larsson
Alexander Larsson
Depends on:
Blocks:
 
 
Reported: 2005-08-26 15:28 UTC by Matthias Clasen
Modified: 2005-08-26 16:02 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12



Description Matthias Clasen 2005-08-26 15:28:46 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:
Comment 1 Matthias Clasen 2005-08-26 15:34:31 UTC
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)
     {
Comment 2 Matthias Clasen 2005-08-26 15:34:52 UTC
(I would have attached the patch, but I kept running into file chooser crashes...)
Comment 3 Federico Mena Quintero 2005-08-26 15:57:56 UTC
Oh my, that's horrible :)  Please go ahead and commit it.  Thanks for taking the
time to find it!
Comment 4 Matthias Clasen 2005-08-26 16:02:45 UTC
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)