From: Ricardo Mones Date: Fri, 2 Aug 2013 08:00:34 +0000 (+0200) Subject: Fix access beyond array bounds X-Git-Tag: 3.9.3~79 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=ace330d0e991cc03340135c5eafa509337ab5755;hp=0ea8cc7e15b0f7d210f7b891df71ce0b5f9abd7d Fix access beyond array bounds Which shouldn't happen, but keeps the compiler happy... --- diff --git a/src/toolbar.c b/src/toolbar.c index 690073a48..5259f4113 100644 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -242,7 +242,7 @@ struct { struct { const gchar *conf_file; GSList *item_list; -} toolbar_config[3] = { +} toolbar_config[NUM_TOOLBARS] = { { "toolbar_main.xml", NULL}, { "toolbar_compose.xml", NULL}, { "toolbar_msgview.xml", NULL} @@ -767,7 +767,7 @@ void toolbar_read_config_file(ToolbarType source) else if (source == TOOLBAR_MSGVIEW) toolbar_set_default(TOOLBAR_MSGVIEW); else { - g_warning("failed to write Toolbar Configuration to %s\n", toolbar_config[source].conf_file); + g_warning("refusing to write unknown Toolbar Configuration number %d\n", source); return; } diff --git a/src/toolbar.h b/src/toolbar.h index f0cd8c865..7eebad2f9 100644 --- a/src/toolbar.h +++ b/src/toolbar.h @@ -34,6 +34,8 @@ typedef enum { TOOLBAR_MSGVIEW } ToolbarType; +#define NUM_TOOLBARS 3 + typedef enum { COMPOSEBUTTON_MAIL,