[gtk+/native-layout] Handle out-of-bounds parameters in gtk_assistant_get_nth_page
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/native-layout] Handle out-of-bounds parameters in gtk_assistant_get_nth_page
- Date: Sun, 4 Apr 2010 02:30:18 +0000 (UTC)
commit 624ac853bac75ee5de03b272eba7b46ac3808e3a
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Feb 23 11:23:10 2010 -0500
Handle out-of-bounds parameters in gtk_assistant_get_nth_page
Better do what the docs say...fix by Tadej Borovšak, bug 610141.
gtk/gtkassistant.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index daec0cf..5fd6d83 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -1615,10 +1615,14 @@ gtk_assistant_get_nth_page (GtkAssistant *assistant,
GList *elem;
g_return_val_if_fail (GTK_IS_ASSISTANT (assistant), NULL);
+ g_return_val_if_fail (page_num >= -1, NULL);
priv = assistant->priv;
- elem = g_list_nth (priv->pages, page_num);
+ if (page_num == -1)
+ elem = g_list_last (priv->pages);
+ else
+ elem = g_list_nth (priv->pages, page_num);
if (!elem)
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]