summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
authorAntia Puentes <[email protected]>2013-07-30 19:33:12 +0200
committermonsta <[email protected]>2018-04-09 11:56:05 +0300
commit35751a64f5ecd4c925df94c1b47343e2fd47f034 (patch)
tree1fb0183cd426c72bca421566c5b1fbbd5fa07555 /libview
parent1c14dc96ca40048ecb290962005f6100074b59d8 (diff)
downloadatril-35751a64f5ecd4c925df94c1b47343e2fd47f034.tar.bz2
atril-35751a64f5ecd4c925df94c1b47343e2fd47f034.tar.xz
ev-view-accessible: Fix a crash in ev_view_accessible_get_link
Check array limits returning early if the link index is out of range. https://bugzilla.gnome.org/show_bug.cgi?id=705155 https://git.gnome.org/browse/evince/commit/?h=gnome-3-10&id=7eac53f
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-view-accessible.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libview/ev-view-accessible.c b/libview/ev-view-accessible.c
index e415b71b..de728835 100644
--- a/libview/ev-view-accessible.c
+++ b/libview/ev-view-accessible.c
@@ -829,6 +829,9 @@ ev_view_accessible_get_link (AtkHypertext *hypertext,
EvMapping *mapping;
EvLinkAccessible *atk_link;
+ if (link_index < 0)
+ return NULL;
+
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (hypertext));
if (widget == NULL)
/* State is defunct */
@@ -849,6 +852,9 @@ ev_view_accessible_get_link (AtkHypertext *hypertext,
return NULL;
n_links = ev_mapping_list_length (link_mapping);
+ if (link_index > n_links - 1)
+ return NULL;
+
mapping = ev_mapping_list_nth (link_mapping, n_links - link_index - 1);
atk_link = ev_link_accessible_new (EV_VIEW_ACCESSIBLE (hypertext),
EV_LINK (mapping->data),