mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-13 14:05:05 +01:00
Avoid possible memory corruption in xdgmime, fd.o bug 12512, reported by
2008-04-16 Matthias Clasen <mclasen@redhat.com> Avoid possible memory corruption in xdgmime, fd.o bug 12512, reported by Joe Shaw and Federico Mena Quintero. * xdgmime/xdgmime.c(_xdg_mime_media_type_equal): Implement. (xdg_mime_media_type_equal): Turn into a wrapper around the _-prefixed version. * xdgmime/xdgmimecache.c: Use the _-prefixed versions of comparison functions throughout. svn path=/trunk/; revision=6854
This commit is contained in:
parent
8e964bf99a
commit
101521f6e4
@ -1,3 +1,15 @@
|
|||||||
|
2008-04-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Avoid possible memory corruption in xdgmime, fd.o bug 12512,
|
||||||
|
reported by Joe Shaw and Federico Mena Quintero.
|
||||||
|
|
||||||
|
* xdgmime/xdgmime.c(_xdg_mime_media_type_equal): Implement.
|
||||||
|
(xdg_mime_media_type_equal): Turn into a wrapper around the
|
||||||
|
_-prefixed version.
|
||||||
|
|
||||||
|
* xdgmime/xdgmimecache.c: Use the _-prefixed versions of comparison
|
||||||
|
functions throughout.
|
||||||
|
|
||||||
2008-04-16 Michael Meeks <michael.meeks@novell.com>
|
2008-04-16 Michael Meeks <michael.meeks@novell.com>
|
||||||
|
|
||||||
* gdesktopappinfo.c (g_desktop_app_info_new_from_filename):
|
* gdesktopappinfo.c (g_desktop_app_info_new_from_filename):
|
||||||
|
@ -684,13 +684,11 @@ xdg_mime_mime_type_equal (const char *mime_a,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xdg_mime_media_type_equal (const char *mime_a,
|
_xdg_mime_media_type_equal (const char *mime_a,
|
||||||
const char *mime_b)
|
const char *mime_b)
|
||||||
{
|
{
|
||||||
char *sep;
|
char *sep;
|
||||||
|
|
||||||
xdg_mime_init ();
|
|
||||||
|
|
||||||
sep = strchr (mime_a, '/');
|
sep = strchr (mime_a, '/');
|
||||||
|
|
||||||
if (sep && strncmp (mime_a, mime_b, sep - mime_a + 1) == 0)
|
if (sep && strncmp (mime_a, mime_b, sep - mime_a + 1) == 0)
|
||||||
@ -699,6 +697,15 @@ xdg_mime_media_type_equal (const char *mime_a,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
xdg_mime_media_type_equal (const char *mime_a,
|
||||||
|
const char *mime_b)
|
||||||
|
{
|
||||||
|
xdg_mime_init ();
|
||||||
|
|
||||||
|
return _xdg_mime_media_type_equal (mime_a, mime_b);
|
||||||
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
static int
|
static int
|
||||||
xdg_mime_is_super_type (const char *mime)
|
xdg_mime_is_super_type (const char *mime)
|
||||||
|
@ -297,7 +297,7 @@ cache_magic_lookup_data (XdgMimeCache *cache,
|
|||||||
for (n = 0; n < n_mime_types; n++)
|
for (n = 0; n < n_mime_types; n++)
|
||||||
{
|
{
|
||||||
if (mime_types[n] &&
|
if (mime_types[n] &&
|
||||||
xdg_mime_mime_type_equal (mime_types[n], non_match))
|
_xdg_mime_mime_type_equal (mime_types[n], non_match))
|
||||||
mime_types[n] = NULL;
|
mime_types[n] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -797,7 +797,7 @@ _xdg_mime_cache_mime_type_subclass (const char *mime,
|
|||||||
#if 1
|
#if 1
|
||||||
/* Handle supertypes */
|
/* Handle supertypes */
|
||||||
if (is_super_type (ubase) &&
|
if (is_super_type (ubase) &&
|
||||||
xdg_mime_media_type_equal (umime, ubase))
|
_xdg_mime_media_type_equal (umime, ubase))
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user