From 2628ad0b6e264df858ce0fbc83b909bc7dab9c4a Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Sat, 24 Jun 2023 16:33:38 +0100 Subject: [PATCH] Initialise all column widths in set_dimensions_pass_two() It shouldn't be possible for the number of columns to be different between the header cursor and the other cursors but the return value from g_table_index() is checked just in case this happens. If this did happen, the width would be set using an uninitialised value so initialise them all to 0. --- gnucash/register/register-gnome/gnucash-style.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnucash/register/register-gnome/gnucash-style.c b/gnucash/register/register-gnome/gnucash-style.c index da8c6045290..eb99e72180d 100644 --- a/gnucash/register/register-gnome/gnucash-style.c +++ b/gnucash/register/register-gnome/gnucash-style.c @@ -277,7 +277,7 @@ set_dimensions_pass_two (GnucashSheet *sheet, int default_width) width = 0; num_cols = cursor->num_cols; - widths = g_new (int, num_cols); + widths = g_new0 (int, num_cols); /* find header widths */ for (col = 0; col < num_cols; col++)