From c3a40f4f8215236f151995cf1c55caa3725e7ff2 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 17 2017 15:26:04 +0000 Subject: import spice-gtk-0.31-6.el7_3.2 --- diff --git a/SOURCES/0024-clipboard-Fix-crash-by-handling-error.patch b/SOURCES/0024-clipboard-Fix-crash-by-handling-error.patch new file mode 100644 index 0000000..f5cac1b --- /dev/null +++ b/SOURCES/0024-clipboard-Fix-crash-by-handling-error.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Victor Toso +Date: Fri, 14 Oct 2016 18:12:01 +0200 +Subject: [PATCH] clipboard: Fix crash by handling error + +As manual states below, text could be NULL for different reasons and +we should handle that. I've included a debug message to help +identifying possible regressions from wayland's clipboard. + +This crash is a regression from 7b0de6217670e0f668aff2949f + + "The text parameter to callback will contain the resulting text if + the request succeeded, or NULL if it failed. This could happen for + various reasons, in particular if the clipboard was empty or if the + contents of the clipboard could not be converted into text form." + +Resolves: rhbz#1384676 + +Signed-off-by: Victor Toso +Acked-by: Pavel Grunt +(cherry picked from commit 03c016bea939ee4a26e90d80fa1012a993a8ea47) +--- + src/spice-gtk-session.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c +index f04d5e8..2da9bc0 100644 +--- a/src/spice-gtk-session.c ++++ b/src/spice-gtk-session.c +@@ -918,6 +918,11 @@ static void clipboard_received_text_cb(GtkClipboard *clipboard, + if (self == NULL) + return; + ++ if (text == NULL) { ++ SPICE_DEBUG("Failed to retrieve clipboard text"); ++ return; ++ } ++ + g_return_if_fail(SPICE_IS_GTK_SESSION(self)); + + selection = get_selection_from_clipboard(self->priv, clipboard); diff --git a/SPECS/spice-gtk.spec b/SPECS/spice-gtk.spec index 59af088..62f8a8a 100644 --- a/SPECS/spice-gtk.spec +++ b/SPECS/spice-gtk.spec @@ -13,7 +13,7 @@ Name: spice-gtk Version: 0.31 -Release: 6%{?dist} +Release: 6%{?dist}.2 Summary: A GTK+ widget for SPICE clients Group: System Environment/Libraries @@ -44,6 +44,7 @@ Patch0020: 0020-clipboard-Add-fixup_clipboard_text-helper.patch Patch0021: 0021-clipboard-Use-gtk_clipboard_request_text-for-text-da.patch Patch0022: 0022-util-Remove-unused-GError-parameter.patch Patch0023: 0023-clipboard-Return-early-if-check_clipboard_size_limit.patch +Patch0024: 0024-clipboard-Fix-crash-by-handling-error.patch Patch1000: 1000-gtk-Makefile.am-add-PIE-flags-to-libspice-client-gli.patch BuildRequires: intltool @@ -200,6 +201,7 @@ pushd spice-gtk-%{version} %patch0021 -p1 %patch0022 -p1 %patch0023 -p1 +%patch0024 -p1 %patch1000 -p1 find . -name '*.stamp' | xargs touch popd @@ -323,6 +325,14 @@ rm -rf %{buildroot}%{_datadir}/pkgconfig/spice-protocol.pc %{_bindir}/spicy-stats %changelog +* Thu Nov 10 2016 Victor Toso - 0.31-6.2 +- Rebuild as previous build did not apply patch0024 + Resolves: rhbz#1393046 + +* Thu Nov 10 2016 Victor Toso - 0.31-6.1 +- Avoid crash on clipboard due failure in text conversion + Resolves: rhbz#1393046 + * Fri Sep 9 2016 Pavel Grunt - 0.31-6 - Improve clipboard handling for motif applications Resolves: rhbz#1348624