From 57163955b58975fc594897fc850b096f3009ba22 Mon Sep 17 00:00:00 2001 From: David King Date: Mon, 20 Aug 2018 16:12:31 +0100 Subject: [PATCH] Include a fix for invalid Unicode sequence handling --- ...valid-unicode-sequence-assertion-fix.patch | 36 +++++++++++++++++++ pango.spec | 9 +++-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 pango-invalid-unicode-sequence-assertion-fix.patch diff --git a/pango-invalid-unicode-sequence-assertion-fix.patch b/pango-invalid-unicode-sequence-assertion-fix.patch new file mode 100644 index 0000000..f35ff6f --- /dev/null +++ b/pango-invalid-unicode-sequence-assertion-fix.patch @@ -0,0 +1,36 @@ +From 71aaeaf020340412b8d012fe23a556c0420eda5f Mon Sep 17 00:00:00 2001 +From: Matthias Clasen +Date: Fri, 17 Aug 2018 22:29:36 -0400 +Subject: [PATCH] Prevent an assertion with invalid Unicode sequences + +Invalid Unicode sequences, such as 0x2665 0xfe0e 0xfe0f, +can trick the Emoji iter code into returning an empty +segment, which then triggers an assertion in the itemizer. + +Prevent this by ensuring that we make progress. + +This issue was reported by Jeffrey M. +--- + pango/pango-emoji.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/pango/pango-emoji.c b/pango/pango-emoji.c +index 0e332dff..29472452 100644 +--- a/pango/pango-emoji.c ++++ b/pango/pango-emoji.c +@@ -253,6 +253,12 @@ _pango_emoji_iter_next (PangoEmojiIter *iter) + if (iter->is_emoji == PANGO_EMOJI_TYPE_IS_EMOJI (current_emoji_type)) + { + iter->is_emoji = !PANGO_EMOJI_TYPE_IS_EMOJI (current_emoji_type); ++ ++ /* Make sure we make progress. Weird sequences, like a VC15 followed ++ * by VC16, can trick us into stalling otherwise. */ ++ if (iter->start == iter->end) ++ iter->end = g_utf8_next_char (iter->end); ++ + return TRUE; + } + } +-- +2.17.1 + diff --git a/pango.spec b/pango.spec index d8f1dfe..aa3e0df 100644 --- a/pango.spec +++ b/pango.spec @@ -9,12 +9,13 @@ Name: pango Version: 1.42.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: System for layout and rendering of internationalized text License: LGPLv2+ URL: http://www.pango.org -Source0: http://download.gnome.org/sources/%{name}/1.42/%{name}-%{version}.tar.xz +Source0: https://download.gnome.org/sources/%{name}/1.42/%{name}-%{version}.tar.xz +Patch0: pango-invalid-unicode-sequence-assertion-fix.patch BuildRequires: pkgconfig(cairo) >= %{cairo_version} BuildRequires: pkgconfig(freetype2) >= %{freetype_version} @@ -75,6 +76,7 @@ the functionality of the installed %{name} package. %prep %setup -q -n pango-%{version} +%patch0 -p1 %build @@ -128,6 +130,9 @@ fi %changelog +* Mon Aug 20 2018 David King - 1.42.3-2 +- Include a fix for invalid Unicode sequence handling + * Mon Jul 30 2018 Kalev Lember - 1.42.3-1 - Update to 1.42.3