diff options
author | Kalev Lember <klember@redhat.com> | 2020-04-03 18:59:31 +0200 |
---|---|---|
committer | Kalev Lember <klember@redhat.com> | 2020-04-03 18:59:31 +0200 |
commit | 59891d167aeb8dd73abcafe1a1c96f4cf22ea583 (patch) | |
tree | 00218f9d63e6e460239eb3e9c17b8b370cbbfe41 /0001-imwayland-Clamp-the-surrounding-string-end-correctly.patch | |
parent | Update to 3.24.16 (diff) | |
download | gtk3-classic-build-gtk3-59891d167aeb8dd73abcafe1a1c96f4cf22ea583.tar.gz gtk3-classic-build-gtk3-59891d167aeb8dd73abcafe1a1c96f4cf22ea583.tar.bz2 gtk3-classic-build-gtk3-59891d167aeb8dd73abcafe1a1c96f4cf22ea583.zip |
Backport upstream fixes for an imwayland crash
Diffstat (limited to '0001-imwayland-Clamp-the-surrounding-string-end-correctly.patch')
-rw-r--r-- | 0001-imwayland-Clamp-the-surrounding-string-end-correctly.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/0001-imwayland-Clamp-the-surrounding-string-end-correctly.patch b/0001-imwayland-Clamp-the-surrounding-string-end-correctly.patch new file mode 100644 index 0000000..0ccb5c7 --- /dev/null +++ b/0001-imwayland-Clamp-the-surrounding-string-end-correctly.patch @@ -0,0 +1,34 @@ +From d7fb15c822eabe22ffda19892153d69b0f4fc2f3 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho <carlosg@gnome.org> +Date: Fri, 3 Apr 2020 12:44:37 +0200 +Subject: [PATCH] imwayland: Clamp the surrounding string end correctly + +In the paths where len > MAX_LEN and cursor/anchor are separated by +at least MAX_LEN from text edges, we were clamping the right end of +the surrounding string at MAX_LEN. Oops. + +This end anchor may go as far as the string length, although just +up to len - MAX_LEN in real terms (due to the condition above that +caches cursor/anchor positions being near enough the text end). + +Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2565 +--- + modules/input/imwayland.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/input/imwayland.c b/modules/input/imwayland.c +index 8f697bec1b..12d18a0f64 100644 +--- a/modules/input/imwayland.c ++++ b/modules/input/imwayland.c +@@ -322,7 +322,7 @@ notify_surrounding_text (GtkIMContextWayland *context) + mid = MIN (context->surrounding.cursor_idx, + context->surrounding.anchor_idx) + (cursor_len / 2); + a = MAX (0, mid - (MAX_LEN / 2)); +- b = MIN (MAX_LEN, mid + (MAX_LEN / 2)); ++ b = MIN (len, mid + (MAX_LEN / 2)); + + start = &context->surrounding.text[a]; + end = &context->surrounding.text[b]; +-- +2.25.2 + |