libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |    4 ++++
 vcl/unx/gtk3/gtk3gtkinst.cxx                        |    4 ++++
 2 files changed, 8 insertions(+)

New commits:
commit 678e0ea1472478d248d1a45c1e0ade5ed84f9d46
Author: Michael Stahl <mst...@redhat.com>
Date:   Tue Feb 9 14:13:48 2016 +0100

    vcl, libreofficekit: gtk_clipboard_wait_for_contents() may return null
    
    Don't crash then.
    
    Change-Id: I4980fe4ea56e023cbf303fa43d1e6b383d983d2e

diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx 
b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index b2962d4..7ec2b78 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -656,6 +656,10 @@ static void doPaste(GtkWidget* pButton, gpointer /*pItem*/)
     if (oTarget)
     {
         GtkSelectionData* pSelectionData = 
gtk_clipboard_wait_for_contents(pClipboard, *oTarget);
+        if (!pSelectionData)
+        {
+            return;
+        }
         gint nLength;
         const guchar* pData = 
gtk_selection_data_get_data_with_length(pSelectionData, &nLength);
         bool bSuccess = lok_doc_view_paste(pLOKDocView, aTargetName.c_str(), 
reinterpret_cast<const char*>(pData), nLength);
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index f914e45..32e1a57 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -206,6 +206,10 @@ public:
         css::uno::Any aRet;
         GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard,
                                                                  it->second);
+        if (!data)
+        {
+            return css::uno::Any();
+        }
         gint length;
         const guchar *rawdata = gtk_selection_data_get_data_with_length(data,
                                                                         
&length);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to