Skip to content

gcontenttype: Fix a potential use-after-free of xdgmime data

Philip Withnall requested to merge pwithnall/glib:content-type-locking into main

While gio_xdgmime is unlocked, the data which type points to in the xdgmime cache might get invalidated, leaving type as a dangling pointer. That would not bode well for the g_strdup (type) call to insert a new entry into the type_comment_cache once gio_xdgmime is re-acquired.

This was spotted using static analysis, and the symptoms have not knowingly been seen in the wild.

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Coverity CID: #1474702

Merge request reports