Blame SOURCES/pango-fixes-bidi-crash.patch

ae0738
commit 490f8979a260c16b1df055eab386345da18a2d54
ae0738
Author: Matthias Clasen <mclasen@redhat.com>
ae0738
Date:   Wed Jul 10 20:26:23 2019 -0400
ae0738
ae0738
    bidi: Be safer against bad input
ae0738
    
ae0738
    Don't run off the end of an array that we
ae0738
    allocated to certain length.
ae0738
    
ae0738
    Closes: https://gitlab.gnome.org/GNOME/pango/issues/342
ae0738
ae0738
diff --git a/pango/pango-bidi-type.c b/pango/pango-bidi-type.c
ae0738
index 3e46b66c..5c02dbbb 100644
ae0738
--- a/pango/pango-bidi-type.c
ae0738
+++ b/pango/pango-bidi-type.c
ae0738
@@ -181,8 +181,11 @@ pango_log2vis_get_embedding_levels (const gchar    *text,
ae0738
   for (i = 0, p = text; p < text + length; p = g_utf8_next_char(p), i++)
ae0738
     {
ae0738
       gunichar ch = g_utf8_get_char (p);
ae0738
-      FriBidiCharType char_type;
ae0738
-      char_type = fribidi_get_bidi_type (ch);
ae0738
+      FriBidiCharType char_type = fribidi_get_bidi_type (ch);
ae0738
+
ae0738
+      if (i == n_chars)
ae0738
+        break;
ae0738
+
ae0738
       bidi_types[i] = char_type;
ae0738
       ored_types |= char_type;
ae0738
       if (FRIBIDI_IS_STRONG (char_type))