[evince/gnome-3-24] a11y: Fix crash with Orca screen reader
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/gnome-3-24] a11y: Fix crash with Orca screen reader
- Date: Sun, 26 Mar 2017 09:19:01 +0000 (UTC)
commit e0a7944d92c704aa80c31c08a383c92c302c19b1
Author: Jason Crain <jason inspiresomeone us>
Date: Tue Mar 21 22:55:50 2017 -0500
a11y: Fix crash with Orca screen reader
ev_page_accessible_get_substring gets called with out of bounds values
leading to a crash. Clamp start_offset to a valid range.
https://bugzilla.gnome.org/show_bug.cgi?id=777992
libview/ev-page-accessible.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libview/ev-page-accessible.c b/libview/ev-page-accessible.c
index 214726c..0a8a082 100644
--- a/libview/ev-page-accessible.c
+++ b/libview/ev-page-accessible.c
@@ -487,9 +487,9 @@ ev_page_accessible_get_substring (AtkText *text,
return NULL;
page_text = ev_page_cache_get_text (view->page_cache, self->priv->page);
- start_offset = MAX (0, start_offset);
if (end_offset < 0 || end_offset > g_utf8_strlen (page_text, -1))
end_offset = strlen (page_text);
+ start_offset = CLAMP (start_offset, 0, end_offset);
substring = g_utf8_substring (page_text, start_offset, end_offset);
normalized = g_utf8_normalize (substring, -1, G_NORMALIZE_NFKC);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]