From: Dr. David Alan Gilbert Date: Sat, 30 Jul 2022 15:39:18 +0000 (+0100) Subject: x11: Don't assume valid type X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~4^2~15^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dbc4e18bf8ca175262cfb4c28b232b9d5ede3609;p=gtk4.git x11: Don't assume valid type If we get an invalid TARGETS reply, we might not have a valid 'type', which ends up as NULL and segs in the g_str_equal. (This is probably fallout from my fix 506566b6a4c3a9, which I still can't reproduce reliably, so the last one just moved the seg a bit further along, and we still don't know who is sending a bad TARGETS). This corresponds to: https://bugzilla.redhat.com/show_bug.cgi?id=2062143 --- diff --git a/gdk/x11/gdkclipboard-x11.c b/gdk/x11/gdkclipboard-x11.c index db2815ed52..f634536b3f 100644 --- a/gdk/x11/gdkclipboard-x11.c +++ b/gdk/x11/gdkclipboard-x11.c @@ -358,10 +358,10 @@ gdk_x11_clipboard_request_targets_got_stream (GObject *source, g_error_free (error); return; } - else if (!g_str_equal (type, "ATOM") || format != 32) + else if (g_strcmp0 (type, "ATOM") != 0 || format != 32) { GDK_DISPLAY_NOTE (display, CLIPBOARD, g_printerr ("%s: Wrong reply type to TARGETS: type %s != ATOM or format %d != 32\n", - cb->selection, type, format)); + cb->selection, type ? type : "NULL", format)); g_input_stream_close (stream, NULL, NULL); g_object_unref (stream); g_object_unref (cb);