From 8cedc3b8b082c439709b649c5ffbe60f6365c04f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 10 May 2011 18:03:43 +0200 Subject: [PATCH] Prevent crash in wayland mimedata in case there is no offer. --- src/plugins/platforms/wayland/qwaylandclipboard.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylandclipboard.cpp b/src/plugins/platforms/wayland/qwaylandclipboard.cpp index c1ac386..47ca228 100644 --- a/src/plugins/platforms/wayland/qwaylandclipboard.cpp +++ b/src/plugins/platforms/wayland/qwaylandclipboard.cpp @@ -199,6 +199,8 @@ void QWaylandClipboard::forceRoundtrip(struct wl_display *display) QVariant QWaylandClipboard::retrieveData(const QString &mimeType, QVariant::Type type) const { Q_UNUSED(type); + if (mOfferedMimeTypes.isEmpty() || !mOffer) + return QVariant(); int pipefd[2]; if (pipe(pipefd) == -1) { qWarning("QWaylandClipboard: pipe() failed"); -- 2.7.4