GNOME Bugzilla – Bug 565484
g_content_type_guess passes non-UTF8 text to XDG functions in non-UTF8 locale
Last modified: 2009-01-12 20:25:07 UTC
Original bug report: http://bugs.debian.org/509582 This bug only occurs in a non-UTF8 locale (e.g. fr_FR@euro), when using local encoding filenames, with or without G_BROKEN_FILENAMES. To reproduce it: mkdir /tmp/toto echo text > /tmp/toto/AA1-XxxxxXxxxxxxxé (the filename must be in iso8859-1 encoding here) Then try to open this file with the file chooser in gedit. To be sure to see the bug it is better to set MALLOC_CHECK_=2. In which case, the libc always aborts at xdgmimeglob.c:401 (free(ucs4);). The reason is that, in this case, g_content_type_guess passes an invalid UTF8 string to xdg_mime_get_mime_types_from_file_name, and the XDG functions all assume their input is valid UTF8. Full backtrace :
+ Trace 211030
*** Bug 565982 has been marked as a duplicate of this bug. ***
Apparently fixed in trunk and 2.18.4. * xdgmime/xdgmimecache.c: * xdgmime/xdgmimeglob.c: Don't assume filenames are UTF-8.