[gtk+/gtk-2-18] Handle out-of-bounds parameters in gtk_assistant_get_nth_page
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-18] Handle out-of-bounds parameters in gtk_assistant_get_nth_page
- Date: Fri, 12 Mar 2010 23:03:01 +0000 (UTC)
commit 9268b235226d02037dca9afef841b32a4f5e19dd
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.
(cherry picked from commit 06d02578f81db5f1233ec76ca6441053f3e54fa3)
gtk/gtkassistant.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 48d8506..7e3a458 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -1612,10 +1612,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]