From 61d32f70fc30533f6c4ceeb5bbb299a567d207e6 Mon Sep 17 00:00:00 2001 From: Mathias Hasselmann Date: Mon, 18 Aug 2008 22:20:19 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20541600=20=E2=80=93=20GtkCalendar=20segfau?= =?UTF-8?q?lt=20for=20certain=20values=20of=20detail-with-chars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gtk/gtkcalendar.c (gtk_calendar_class_init()): Limit the "year" property to G_MAXINT >> 9, instead of G_MAXINT >> 8: year_to_days() multiplies the year property with 365 and returns the result as glong. Therefore ceil(log(365, 2)) = 9 bits must be available, not just 8 bits. svn path=/trunk/; revision=21150 --- ChangeLog | 10 ++++++++++ gtk/gtkcalendar.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index eb1967da28..8bf50c2f3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-08-19 Mathias Hasselmann + + Bug 541600 – GtkCalendar segfault for certain values of detail-with-chars + + * gtk/gtkcalendar.c (gtk_calendar_class_init()): Limit the "year" + property to G_MAXINT >> 9, instead of G_MAXINT >> 8: year_to_days() + multiplies the year property with 365 and returns the result as + glong. Therefore ceil(log(365, 2)) = 9 bits must be available, + not just 8 bits. + 2008-08-18 Björn Lindqvist Bug 541315 – Segfault when selecting a GtkMenuItem with submenu diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 31b14c91d4..964b4bcbbd 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -439,7 +439,7 @@ gtk_calendar_class_init (GtkCalendarClass *class) g_param_spec_int ("year", P_("Year"), P_("The selected year"), - 0, G_MAXINT >> 8, 0, + 0, G_MAXINT >> 9, 0, GTK_PARAM_READWRITE)); /**