From 6c98ef3356590a62416a5550b27c0c5354da52df Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 28 Apr 2007 21:29:05 +0000 Subject: Recognize negative column indices as invalid. (#415260, Chris Wilson) 2007-04-28 Matthias Clasen * gtk/gtkliststore.c (gtk_list_store_set_valist_internal): * gtk/gtktreestore.c (gtk_tree_store_set_valist_internal): Recognize negative column indices as invalid. (#415260, Chris Wilson) svn path=/trunk/; revision=17681 --- gtk/gtkliststore.c | 2 +- gtk/gtktreestore.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gtk') diff --git a/gtk/gtkliststore.c b/gtk/gtkliststore.c index e095b05cc7..0d0bed6b9b 100644 --- a/gtk/gtkliststore.c +++ b/gtk/gtkliststore.c @@ -731,7 +731,7 @@ gtk_list_store_set_valist_internal (GtkListStore *list_store, GValue value = { 0, }; gchar *error = NULL; - if (column >= list_store->n_columns) + if (column < 0 || column >= list_store->n_columns) { g_warning ("%s: Invalid column number %d added to iter (remember to end your list of columns with a -1)", G_STRLOC, column); break; diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c index 740b293f4d..55a89af428 100644 --- a/gtk/gtktreestore.c +++ b/gtk/gtktreestore.c @@ -884,7 +884,7 @@ gtk_tree_store_set_valist_internal (GtkTreeStore *tree_store, GValue value = { 0, }; gchar *error = NULL; - if (column >= tree_store->n_columns) + if (column < 0 || column >= tree_store->n_columns) { g_warning ("%s: Invalid column number %d added to iter (remember to end your list of columns with a -1)", G_STRLOC, column); break; -- cgit v1.2.1