xdg_mime_init_from_directory() calls realloc(), but requests a size that is too
small to fit the required number of (XdgMimeCache *). The attached patch fixes
Created attachment 2863 [details]
Test case for XSelectInput problem
2005-05-28 Federico Mena Quintero <email@example.com>
* xdgmime.c (xdg_mime_init_from_directory): Pass the correct size
Out of curiosity, how did you catch it? Were you fixing a specific bug?
Uh, I was having spurious crashes in the file chooser within my jhbuild
checkout. First I thought something else may be broken in my jhbuild tree, but
then I decided to look, as some operations on folders looked reproducible.
I *think* I found it with MALLOC_CHECK_=2 under gdb, but I don't remember --- I
found the bug while half coding, half listening to a Guadec talk :)
ok, I was asking because there are a bunch of bug reports like
http://bugzilla.gnome.org/show_bug.cgi?id=306143 being reported, and I was
wondering if your patch could fix those. Guess I'll have to find someone getting
crashes and willing to test the patch ;)
Let me check if the copy of xdgmime within gnome-vfs is okay...
Blah, the copy within gnome-vfs-2.10 is not even the one with the MIME cache.
Or at least, it's different from the copy that is inside GTK+.
Just applied the patch to gnome-vfs HEAD. That one does use the caches.