From 643f315e45ea061cd5201467806730ac7dd3c0b2 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 18 Jun 2020 18:33:22 -0700 Subject: [PATCH] Backport MR #206 to fix #485 (crash triggered in various ways) --- ...splice-return-if-list-attributes-is-.patch | 31 +++++++++++++++++++ pango.spec | 10 +++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0001-pango_attr_list_splice-return-if-list-attributes-is-.patch diff --git a/0001-pango_attr_list_splice-return-if-list-attributes-is-.patch b/0001-pango_attr_list_splice-return-if-list-attributes-is-.patch new file mode 100644 index 0000000..bcf25d3 --- /dev/null +++ b/0001-pango_attr_list_splice-return-if-list-attributes-is-.patch @@ -0,0 +1,31 @@ +From 8dc76b868af97dfd9456057772d635e0d2f1593b Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Thu, 18 Jun 2020 18:29:16 -0700 +Subject: [PATCH] pango_attr_list_splice: return if list->attributes is NULL + (#485) + +There seem to be various ways to get into this function with +list defined but list->attributes as NULL, so we need to check +for that too. Patch inspired by @shlomif , but adjusted to follow +the style of the other checks. + +Signed-off-by: Adam Williamson +--- + pango/pango-attributes.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c +index 37443346..a007e6fd 100644 +--- a/pango/pango-attributes.c ++++ b/pango/pango-attributes.c +@@ -1763,6 +1763,7 @@ pango_attr_list_splice (PangoAttrList *list, + guint upos, ulen; + + g_return_if_fail (list != NULL); ++ g_return_if_fail (list->attributes != NULL); + g_return_if_fail (other != NULL); + g_return_if_fail (pos >= 0); + g_return_if_fail (len >= 0); +-- +2.27.0 + diff --git a/pango.spec b/pango.spec index e38f4ed..c664e10 100644 --- a/pango.spec +++ b/pango.spec @@ -9,12 +9,17 @@ Name: pango Version: 1.45.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: System for layout and rendering of internationalized text License: LGPLv2+ URL: http://www.pango.org Source0: https://download.gnome.org/sources/%{name}/1.45/%{name}-%{version}.tar.xz +# Fix a crash that can be triggered in various ways, including +# typing Japanese: +# https://gitlab.gnome.org/GNOME/pango/-/issues/485 +# https://gitlab.gnome.org/GNOME/pango/-/merge_requests/206 +Patch0: 0001-pango_attr_list_splice-return-if-list-attributes-is-.patch BuildRequires: pkgconfig(cairo) >= %{cairo_version} BuildRequires: pkgconfig(freetype2) >= %{freetype_version} @@ -128,6 +133,9 @@ fi %changelog +* Thu Jun 18 2020 Adam Williamson - 1.45.2-2 +- Backport MR #206 to fix #485 (crash triggered in various ways) + * Thu Jun 11 2020 Kalev Lember - 1.45.2-1 - Update to 1.45.2