[Spice-devel] [PATCH spice-gtk 2/2] clipboard: check that clipboard request does not belong to remote

Marc-André Lureau marcandre.lureau at gmail.com
Thu May 15 04:12:43 PDT 2014


From: Marc-André Lureau <marcandre.lureau at gmail.com>

Check clipboard owner, to avoid cyclic dependency of clipboard requests.
---
 gtk/spice-gtk-session.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gtk/spice-gtk-session.c b/gtk/spice-gtk-session.c
index 5b8639c..1b05b85 100644
--- a/gtk/spice-gtk-session.c
+++ b/gtk/spice-gtk-session.c
@@ -814,6 +814,9 @@ static gboolean clipboard_request(SpiceMainChannel *main, guint selection,
     GtkClipboard* cb;
     int m;
 
+    g_return_val_if_fail(s->clipboard_by_guest[selection] == FALSE, FALSE);
+    g_return_val_if_fail(s->clip_grabbed, FALSE);
+
     if (read_only(self))
         return FALSE;
 
-- 
1.9.0



More information about the Spice-devel mailing list