Fix bug #3796 format-security warnings in alertpanel_ use
authorAndreas Bierfert <andreas.bierfert@lowlatency.de>
Wed, 29 Mar 2017 08:03:11 +0000 (10:03 +0200)
committerRicardo Mones <ricardo@mones.org>
Wed, 29 Mar 2017 22:42:38 +0000 (00:42 +0200)
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.

src/compose.c
src/mimeview.c
src/plugins/archive/archiver_gtk.c

index 4a29775..b7a7f76 100644 (file)
@@ -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);
index 305b5e5..3ffdd18 100644 (file)
@@ -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);
        }
index 19a842d..ca74c3b 100644 (file)
@@ -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;
                }