diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-03-26 19:48:41 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-03-26 20:27:55 -0400 |
commit | dbcd24adf4b3fccdf23cc98e132fe75f4f63df3f (patch) | |
tree | 37cf09c4afdceae1329fd63cc7b96a5296e75617 | |
parent | 08f68cce403ae73014e03f5dc62640753f290ce7 (diff) | |
download | gtk+-dbcd24adf4b3fccdf23cc98e132fe75f4f63df3f.tar.gz |
composetable: Limit algorithmic checking
Only check for combinations of up to 2 dead keys with
a base character. We don't want to spend ages generating
all permutations of long sequences.
-rw-r--r-- | gtk/gtkcomposetable.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/gtkcomposetable.c b/gtk/gtkcomposetable.c index fb5ab6abe6..7aa9792e3b 100644 --- a/gtk/gtkcomposetable.c +++ b/gtk/gtkcomposetable.c @@ -1190,6 +1190,12 @@ gtk_check_algorithmically (const guint16 *compose_buffer, for (i = 0; i < n_compose && IS_DEAD_KEY (compose_buffer[i]); i++) ; + + /* Allow at most 2 dead keys */ + if (i > 2) + return FALSE; + + /* Can't combine if there's no base character */ if (i == n_compose) return TRUE; |