mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-07 08:28:43 +02:00
xdgmime: Handle buggy type definitions with circular inheritance
This fixes a stack overflow reported by a user who had both the
definition of text/javascript from shared-mime-info 2.3 and the
definition of text/javascript from shared-mime-info 2.4 installed at the
same time. In 2.3, text/javascript is a subtype of
application/ecmascript, but in 2.4 application/ecmascript is a subtype
of text/javascript. Having both at the same time resulted in circular
inheritance.
The new logic keeps a list of all parents that have already been
checked, which is more comprehensive than the old workaround that was
implemented in commit 38869ece2
("xdgmime: Prevent infinite loops from
badly-formed MIME registrations").
https://bugs.archlinux.org/task/80279
This commit is contained in:
@@ -70,7 +70,8 @@ int _xdg_mime_cache_mime_type_equal (const char *mime_a,
|
||||
int _xdg_mime_cache_media_type_equal (const char *mime_a,
|
||||
const char *mime_b);
|
||||
int _xdg_mime_cache_mime_type_subclass (const char *mime_a,
|
||||
const char *mime_b);
|
||||
const char *mime_b,
|
||||
const char **seen);
|
||||
char **_xdg_mime_cache_list_mime_parents (const char *mime);
|
||||
const char *_xdg_mime_cache_unalias_mime_type (const char *mime);
|
||||
int _xdg_mime_cache_get_max_buffer_extents (void);
|
||||
|
Reference in New Issue
Block a user