diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2003-12-17 22:47:55 +0000 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2003-12-17 22:47:55 +0000 |
commit | 3ea41a9212435b879708d8fd42bef0f9be01ce7c (patch) | |
tree | 365411ad7a3b30bac9f81e7f0587efca5b4519f4 /gtk/gtktreemodelsort.c | |
parent | b1187d9e0edb325b6123e35e93b6547e483e6242 (diff) | |
download | gtk+-3ea41a9212435b879708d8fd42bef0f9be01ce7c.tar.gz |
Check that index is not bigger than level array length also when depth is
2003-12-17 Marco Pesenti Gritti <marco@gnome.org>
* gtk/gtktreemodelsort.c: (gtk_tree_model_sort_get_iter):
Check that index is not bigger than level array length
also when depth is 1. Now get_iter_first correctly return
FALSE when the model is empty (#129411).
Diffstat (limited to 'gtk/gtktreemodelsort.c')
-rw-r--r-- | gtk/gtktreemodelsort.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/gtktreemodelsort.c b/gtk/gtktreemodelsort.c index eacb3d5c0a..ab393219c3 100644 --- a/gtk/gtktreemodelsort.c +++ b/gtk/gtktreemodelsort.c @@ -970,8 +970,12 @@ gtk_tree_model_sort_get_iter (GtkTreeModel *tree_model, level = g_array_index (level->array, SortElt, indices[i]).children; } - if (level == NULL) - return FALSE; + if (!level || indices[i] >= level->array->len) + { + iter->stamp = 0; + return FALSE; + } + iter->stamp = tree_model_sort->stamp; iter->user_data = level; iter->user_data2 = &g_array_index (level->array, SortElt, indices[depth - 1]); |