gnucash maint: Bug 742624 - [patch] Scheduled Transaction Editor results in immediate segfault

Geert Janssens gjanssens at code.gnucash.org
Sat Jan 24 11:06:58 EST 2015


Updated	 via  https://github.com/Gnucash/gnucash/commit/2494bfc6 (commit)
	from  https://github.com/Gnucash/gnucash/commit/d5da5933 (commit)



commit 2494bfc63fe1374cae1ffd2a8492245c6a30bc57
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Sat Jan 24 17:33:39 2015 +0100

    Bug 742624 - [patch] Scheduled Transaction Editor results in immediate segfault

diff --git a/src/gnome-utils/gnc-dense-cal.c b/src/gnome-utils/gnc-dense-cal.c
index 3b70255..8f2e047 100644
--- a/src/gnome-utils/gnc-dense-cal.c
+++ b/src/gnome-utils/gnc-dense-cal.c
@@ -261,7 +261,7 @@ _gdc_get_view_options(void)
 static void
 gnc_dense_cal_init(GncDenseCal *dcal)
 {
-    gboolean colorAllocSuccess;
+    gboolean colorAllocSuccess[MAX_COLORS];
 
     gtk_widget_push_composite_child();
 
@@ -348,10 +348,14 @@ gnc_dense_cal_init(GncDenseCal *dcal)
 
     gdk_color_parse(MONTH_THIS_COLOR,  &dcal->weekColors[MONTH_THIS]);
     gdk_color_parse(MONTH_THAT_COLOR,  &dcal->weekColors[MONTH_THAT]);
+
+    /* success array must be as big as number of colors */
+    g_assert(MAX_COLORS == (sizeof(colorAllocSuccess)/sizeof(gboolean)));
+
     if (gdk_colormap_alloc_colors(gdk_colormap_get_system(),
                                   dcal->weekColors,
                                   MAX_COLORS, TRUE, TRUE,
-                                  &colorAllocSuccess) > 0)
+                                  colorAllocSuccess) > 0)
     {
         g_error("error allocating colors");
     }



Summary of changes:
 src/gnome-utils/gnc-dense-cal.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list