talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit e6db5f2b301576156a8d56fb48b81ac9bffd0398
parent 8819febec59e3d5421b0cd4d7882d6524c375bcf
Author: Andreas Bierfert <andreas.bierfert@lowlatency.de>
Date:   Wed, 29 Mar 2017 10:03:11 +0200

Fix bug #3796 format-security warnings in alertpanel_ use

This patch fixes format-security warnings in alertpanel_ use by passing
"%s" as string and the buffer as va argument if no other va arguments
are present.

Diffstat:
Msrc/compose.c | 2+-
Msrc/mimeview.c | 4++--
Msrc/plugins/archive/archiver_gtk.c | 2+-
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/compose.c b/src/compose.c @@ -8792,7 +8792,7 @@ static void compose_template_apply_fields_error(const gchar *header) tr = g_strdup(C_("'%s' stands for a header name", "Template '%s' format error.")); text = g_strdup_printf(tr, prefs_common_translated_header_name(header)); - alertpanel_error(text); + alertpanel_error("%s", text); g_free(text); g_free(tr); diff --git a/src/mimeview.c b/src/mimeview.c @@ -1879,7 +1879,7 @@ static void mimeview_save_all_info(gint errors, gint total) "%d files saved successfully.", total), total); - alertpanel_notice(msg); + alertpanel_notice("%s", msg); g_free(msg); } else { gchar *msg1 = g_strdup_printf( @@ -1892,7 +1892,7 @@ static void mimeview_save_all_info(gint errors, gint total) "%s, %d files failed.", errors), msg1, errors); - alertpanel_warning(msg2); + alertpanel_warning("%s", msg2); g_free(msg2); g_free(msg1); } diff --git a/src/plugins/archive/archiver_gtk.c b/src/plugins/archive/archiver_gtk.c @@ -576,7 +576,7 @@ static gboolean archiver_save_files(struct ArchivePage* page) { if (aval != G_ALERTALTERNATE) return FALSE; } else { - alertpanel_error(msg); + alertpanel_error("%s", msg); g_free(msg); return FALSE; }