[spice-gtk v2] gtk-session: check if retrieving clipboard data failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Victor Toso <me@xxxxxxxxxxxxxx>

In case of failure, the GdkAtom *atoms will be set to NULL.
Including this check to an early return.

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
---
 src/spice-gtk-session.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 0426d8f..8bef7d0 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -609,6 +609,11 @@ static void clipboard_get_targets(GtkClipboard *clipboard,
 
     g_return_if_fail(SPICE_IS_GTK_SESSION(self));
 
+    if (atoms == NULL) {
+        SPICE_DEBUG("Retrieving the clipboard data has failed");
+        return;
+    }
+
     SpiceGtkSessionPrivate *s = self->priv;
     guint32 types[SPICE_N_ELEMENTS(atom2agent)];
     char *name;
-- 
2.9.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]