forked from AuroraMiddleware/gtk
x11: Check return of gdk_x11_get_xatom_name_for_display
When given an invalid atom, gdk_x11_get_xatom_name_for_display can return NULL and trigger a seg in gdk_x11_clipboard_formats_from_atoms. Check for NULL. Why I'm seeing a bad atom there is probably a separate question. https://bugzilla.redhat.com/show_bug.cgi?id=2037786
This commit is contained in:
parent
04c9c6b428
commit
506566b6a4
@ -248,6 +248,10 @@ gdk_x11_clipboard_formats_from_atoms (GdkDisplay *display,
|
|||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
name = gdk_x11_get_xatom_name_for_display (display , atoms[i]);
|
name = gdk_x11_get_xatom_name_for_display (display , atoms[i]);
|
||||||
|
if (!name)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (strchr (name, '/'))
|
if (strchr (name, '/'))
|
||||||
{
|
{
|
||||||
gdk_content_formats_builder_add_mime_type (builder, name);
|
gdk_content_formats_builder_add_mime_type (builder, name);
|
||||||
|
Loading…
Reference in New Issue
Block a user