Backport !3714 “xdgmime: Handle buggy type definitions with circular inheritance” to glib-2-78
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 38869ece ("xdgmime: Prevent infinite loops from badly-formed MIME registrations").
https://bugs.archlinux.org/task/80279
Trivial backport of !3714 (merged) to glib-2-78
.
Edited by Philip Withnall