Bug 3506

Summary: Bad size passed to realloc() in xdg_mime_init_from_directory()
Product: xdgmime Reporter: Daniel Stone <daniel>
Component: xdgmimeAssignee: Jonathan Blandford <jrb>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description FreeDesktop Bugzilla Database Corruption Fix User 2005-06-09 20:35:24 UTC
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
this.
Comment 1 FreeDesktop Bugzilla Database Corruption Fix User 2005-06-09 20:36:19 UTC
Created attachment 2863 [details]
Test case for XSelectInput problem

2005-05-28  Federico Mena Quintero  <federico@ximian.com>

	* xdgmime.c (xdg_mime_init_from_directory): Pass the correct size
	to realloc().
Comment 2 Jonathan Blandford 2005-06-09 21:04:07 UTC
Fixed, thanks
Comment 3 Christophe Fergeau 2005-06-10 00:16:26 UTC
Out of curiosity, how did you catch it? Were you fixing a specific bug?
Comment 4 FreeDesktop Bugzilla Database Corruption Fix User 2005-06-10 08:17:50 UTC
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 :)
Comment 5 Christophe Fergeau 2005-06-10 08:20:43 UTC
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 ;)
Comment 6 FreeDesktop Bugzilla Database Corruption Fix User 2005-06-10 09:11:12 UTC
Let me check if the copy of xdgmime within gnome-vfs is okay...
Comment 7 FreeDesktop Bugzilla Database Corruption Fix User 2005-06-10 09:13:14 UTC
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+.
Comment 8 FreeDesktop Bugzilla Database Corruption Fix User 2005-06-10 09:42:44 UTC
Just applied the patch to gnome-vfs HEAD.  That one does use the caches.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.