[PATCH weston] clipboard: don't crash if the source client does not send a mime type

Giulio Camuffo giuliocamuffo at gmail.com
Thu Apr 30 14:13:55 PDT 2015


---
 src/clipboard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/clipboard.c b/src/clipboard.c
index c1091a9..994c301 100644
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -254,7 +254,7 @@ clipboard_set_selection(struct wl_listener *listener, void *data)
 
 	mime_types = source->mime_types.data;
 
-	if (pipe2(p, O_CLOEXEC) == -1)
+	if (!mime_types || pipe2(p, O_CLOEXEC) == -1)
 		return;
 
 	source->send(source, mime_types[0], p[1]);
-- 
2.3.7



More information about the wayland-devel mailing list