Backport MR #206 to fix #485 (crash triggered in various ways)

This commit is contained in:
Adam Williamson 2020-06-18 18:33:22 -07:00
parent e78c864a2a
commit 643f315e45
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 8dc76b868af97dfd9456057772d635e0d2f1593b Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
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 <awilliam@redhat.com>
---
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

View File

@ -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 <awilliam@redhat.com> - 1.45.2-2
- Backport MR #206 to fix #485 (crash triggered in various ways)
* Thu Jun 11 2020 Kalev Lember <klember@redhat.com> - 1.45.2-1
- Update to 1.45.2