diff --git a/ibus-1385349-segv-bus-proxy.patch b/ibus-1385349-segv-bus-proxy.patch new file mode 100644 index 0000000..ec9390d --- /dev/null +++ b/ibus-1385349-segv-bus-proxy.patch @@ -0,0 +1,111 @@ +From ddb7cb30f10b1d1e40ae4b6c46583941545412d8 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Wed, 26 Jul 2017 21:41:13 +0900 +Subject: [PATCH] bus: Fix SEGV in bus_panel_proxy_focus_in() + +BUG=rhbz#1349148 +BUG=rhbz#1385349 +BUG=rhbz#1350291 +--- + bus/dbusimpl.c | 14 +++++++++++--- + bus/ibusimpl.c | 22 +++++++++++++++++++--- + 2 files changed, 30 insertions(+), 6 deletions(-) + +diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c +index b54ef81..4a60391 100644 +--- a/bus/dbusimpl.c ++++ b/bus/dbusimpl.c +@@ -2,7 +2,8 @@ + /* vim:set et sts=4: */ + /* ibus - The Input Bus + * Copyright (C) 2008-2013 Peng Huang +- * Copyright (C) 2008-2013 Red Hat, Inc. ++ * Copyright (C) 2015-2017 Takao Fujiwara ++ * Copyright (C) 2008-2017 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -1464,13 +1465,20 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection, + gboolean incoming, + gpointer user_data) + { ++ BusDBusImpl *dbus; ++ BusConnection *connection; ++ + g_assert (G_IS_DBUS_CONNECTION (dbus_connection)); + g_assert (G_IS_DBUS_MESSAGE (message)); + g_assert (BUS_IS_DBUS_IMPL (user_data)); + +- BusDBusImpl *dbus = (BusDBusImpl *) user_data; +- BusConnection *connection = bus_connection_lookup (dbus_connection); ++ if (g_dbus_connection_is_closed (dbus_connection)) ++ return NULL; ++ ++ dbus = (BusDBusImpl *) user_data; ++ connection = bus_connection_lookup (dbus_connection); + g_assert (connection != NULL); ++ g_assert (BUS_IS_CONNECTION (connection)); + + if (incoming) { + /* is incoming message */ +diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c +index f99307a..2d43ff6 100644 +--- a/bus/ibusimpl.c ++++ b/bus/ibusimpl.c +@@ -2,7 +2,8 @@ + /* vim:set et sts=4: */ + /* ibus - The Input Bus + * Copyright (C) 2008-2013 Peng Huang +- * Copyright (C) 2008-2013 Red Hat, Inc. ++ * Copyright (C) 2015-2017 Takao Fujiwara ++ * Copyright (C) 2008-2017 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -323,11 +324,14 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, + g_assert (new_name != NULL); + g_assert (BUS_IS_IBUS_IMPL (ibus)); + +- if (g_strcmp0 (name, IBUS_SERVICE_PANEL) == 0) { ++ do { ++ if (g_strcmp0 (name, IBUS_SERVICE_PANEL) != 0) ++ break; + if (g_strcmp0 (new_name, "") != 0) { + /* a Panel process is started. */ + BusConnection *connection; + BusInputContext *context = NULL; ++ GDBusConnection *dbus_connection = NULL; + + if (ibus->panel != NULL) { + ibus_proxy_destroy ((IBusProxy *) ibus->panel); +@@ -338,6 +342,18 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, + connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS, new_name); + g_return_if_fail (connection != NULL); + ++ dbus_connection = bus_connection_get_dbus_connection (connection); ++ ++ /* rhbz#1349148 rhbz#1385349 ++ * Avoid SEGV of BUS_IS_PANEL_PROXY (ibus->panel) ++ * This function is called during destroying the connection ++ * in this case? */ ++ if (dbus_connection == NULL || ++ g_dbus_connection_is_closed (dbus_connection)) { ++ new_name = ""; ++ break; ++ } ++ + ibus->panel = bus_panel_proxy_new (connection); + + g_signal_connect (ibus->panel, +@@ -366,7 +382,7 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, + } + } + } +- } ++ } while (0); + + bus_ibus_impl_component_name_owner_changed (ibus, name, old_name, new_name); + } +-- +2.9.3 + diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch index b1588a7..2322670 100644 --- a/ibus-HEAD.patch +++ b/ibus-HEAD.patch @@ -628,3 +628,38 @@ index ee08c59..4fb7555 100644 -- 2.7.4 +From 4134113a1ae30534367a9ca729c7f36a0a8e3662 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Thu, 27 Jul 2017 14:07:00 +0900 +Subject: [PATCH] ui/gtk3: Fix SEGV of XKeysymToKeycode() on Wayland + +BUG=rhbz#1368593 +--- + ui/gtk3/application.vala | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/ui/gtk3/application.vala b/ui/gtk3/application.vala +index 5ae6e83..fa80272 100644 +--- a/ui/gtk3/application.vala ++++ b/ui/gtk3/application.vala +@@ -3,6 +3,7 @@ + * ibus - The Input Bus + * + * Copyright(c) 2011 Peng Huang ++ * Copyright(c) 2017 Takao Fujiwara + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -99,6 +100,9 @@ class Application { + } + + public static void main(string[] argv) { ++ // for Gdk.X11.get_default_xdisplay() ++ Gdk.set_allowed_backends("x11"); ++ + Application app = new Application(argv); + app.run(); + } +-- +2.9.3 + diff --git a/ibus.spec b/ibus.spec index b3ab2d4..4c47bb3 100644 --- a/ibus.spec +++ b/ibus.spec @@ -28,7 +28,7 @@ Name: ibus Version: 1.5.14 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Intelligent Input Bus for Linux OS License: LGPLv2+ Group: System Environment/Libraries @@ -40,6 +40,8 @@ Source3: https://fujiwara.fedorapeople.org/ibus/po/%{name}-po-1.5.14-2016 # Upstreamed patches. # Patch0: %%{name}-HEAD.patch Patch0: %{name}-HEAD.patch +# Under testing #1349148 #1385349 #1350291 +Patch1: %{name}-1385349-segv-bus-proxy.patch BuildRequires: gettext-devel BuildRequires: libtool @@ -231,6 +233,7 @@ The ibus-devel-docs package contains developer documentation for IBus # %%patch0 -p1 # cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c || %patch0 -p1 +%patch1 -p1 zcat %SOURCE3 | tar xfv - %build @@ -424,6 +427,10 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache &> /dev/null || : %{_datadir}/gtk-doc/html/* %changelog +* Thu Jul 27 2017 Takao Fujiwara - 1.5.14-6 +- Fixed some SEGVs #1349148 #1385349 #1350291 #1368593 + Added 1385349-segv-bus-proxy.patch + * Wed Jan 11 2017 Takao Fujiwara - 1.5.14-5 - support scroll event in candidates panel - Fixed Bug 1403985 - Emoji typing is enabled during Unicode typing