From 9707d964f77a5d82f806b7fec3ac82f5996f967e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 22 Dec 2011 15:57:21 +0100 Subject: [PATCH] combobox: Don't allow an individual cell to cheat Make sure we only set sensitive when the cell is sensitive and visible. Also avoid invalid memory accesses if no cells existed. --- gtk/gtkcombobox.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 79d5d27d8d..4d7fd8add4 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -3885,13 +3885,15 @@ gtk_combo_box_list_select_func (GtkTreeSelection *selection, NULL); if (cell_visible && cell_sensitive) - break; + { + sensitive = TRUE; + break; + } cell = cell->next; } - g_list_free (cells); - sensitive = cell_sensitive; + g_list_free (cells); } g_list_free (columns);