[Spice-devel] [spice-gtk] clipboard: Return early on fixup_clipboard_text errors()

Christophe Fergeau cfergeau at redhat.com
Thu Sep 1 11:11:42 UTC 2016


5c8f400 "clipboard: Add clipboard_atom_to_vdagent_type helper"
mistakenly removed some early returns when text conversion fails for
some reason. This commit readds it.
---
 src/spice-gtk-session.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 5766bbd..e0a79de 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -1026,6 +1026,9 @@ static void clipboard_received_text_cb(GtkClipboard *clipboard,
 
     /* gtk+ internal utf8 newline is always LF, even on windows */
     conv = fixup_clipboard_text(self, text, &len);
+    if (conv == NULL) {
+        return;
+    }
 
     spice_main_clipboard_selection_notify(self->priv->main, selection,
                                           VD_AGENT_CLIPBOARD_UTF8_TEXT,
-- 
2.7.4



More information about the Spice-devel mailing list