From ada766025f1dc32e494e83b806ad625d0756ab1d Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 20 Nov 2013 17:25:48 +0000 Subject: [PATCH] gtktreeviewaccessible: Fix a potential division by zero Found with scan-build. https://bugzilla.gnome.org/show_bug.cgi?id=712760 --- gtk/a11y/gtktreeviewaccessible.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c index fb9e2ce211..21e86b32e5 100644 --- a/gtk/a11y/gtktreeviewaccessible.c +++ b/gtk/a11y/gtktreeviewaccessible.c @@ -954,7 +954,7 @@ gtk_tree_view_accessible_ref_selection (AtkSelection *selection, table = ATK_TABLE (selection); n_columns = gtk_tree_view_accessible_get_n_columns (table); n_selected = gtk_tree_view_accessible_get_selected_rows (table, &selected); - if (i >= n_columns * n_selected) + if (n_columns == 0 || i >= n_columns * n_selected) return NULL; row = selected[i / n_columns];