Skip to content
Permalink
Browse files

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

origin commit:
https://git.gnome.org/browse/evince/commit/?id=b34f357
  • Loading branch information...
jascrain authored and raveit65 committed Mar 22, 2017
1 parent 4065873 commit e3ce0a476ad56a6cbde385fd162ed841efae4d57
Showing with 1 addition and 1 deletion.
  1. +1 −1 libview/ev-page-accessible.c
@@ -489,9 +489,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);

0 comments on commit e3ce0a4

Please sign in to comment.
You can’t perform that action at this time.