Subject: FTBFS with -Werror=format-security
Author: Thibaut Paumard <paumard@users.sourceforge.net>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=643387
Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=660250
Last-Update: 2011-09-27

Debian started building with -Werror=format-security by default. This
causes FTBFS (on purpose) on calls such as "printf(msg)". This patch
corrects such calls to "printf("%s", msg)".
--- a/gap/gap_arr_dialog.c
+++ b/gap/gap_arr_dialog.c
@@ -1859,7 +1859,7 @@
 
        if(run_mode == GIMP_RUN_INTERACTIVE)
        {
-         g_message (msg);
+         g_message ("%s", msg);
        }
     }
   }
--- a/gap/gap_split.c
+++ b/gap/gap_split.c
@@ -347,7 +347,7 @@
                
                errMsg = g_strdup_printf(_("failed to overwrite %s (check permissions ?)")
                                       , l_sav_name);
-               g_message(errMsg);
+               g_message("%s", errMsg);
                g_free(errMsg);
                writePermission = FALSE;
              }
--- a/gap/gap_fmac_base.c
+++ b/gap/gap_fmac_base.c
@@ -96,7 +96,7 @@
 {
   if(run_mode == GIMP_RUN_INTERACTIVE)
   {
-    g_message(msg);
+    g_message("%s", msg);
   }
   printf("%s\n", msg);
   g_free(msg);
--- a/gap/gap_fmac_main.c
+++ b/gap/gap_fmac_main.c
@@ -365,7 +365,7 @@
 {
   if(run_mode == GIMP_RUN_INTERACTIVE)
   {
-    g_message(msg);
+    g_message("%s", msg);
   }
   printf("%s\n", msg);
   g_free(msg);
--- a/gap/gap_morph_exec.c
+++ b/gap/gap_morph_exec.c
@@ -204,7 +204,7 @@
   
   if(run_mode != GIMP_RUN_NONINTERACTIVE)
   {
-    g_message(l_msg);
+    g_message("%s", l_msg);
   }
   g_free(l_msg);
 
--- a/gap/gap_vex_dialog.c
+++ b/gap/gap_vex_dialog.c
@@ -912,7 +912,7 @@
      break;
  }
  g_snprintf(gpp->val.preferred_decoder, sizeof(gpp->val.preferred_decoder)
-               , preferred_decoder
+	    , "%s", preferred_decoder
                );
  entry = GTK_ENTRY(gpp->mw__entry_preferred_decoder);
  if(entry)
--- a/libgapvidutil/gap_gve_sox.c
+++ b/libgapvidutil/gap_gve_sox.c
@@ -153,7 +153,7 @@
                            , cval->tmp_audfile);
         if(cval->run_mode == GIMP_RUN_INTERACTIVE)
         {
-          g_message(l_msg);
+          g_message("%s", l_msg);
             }
         return -1;
      }
@@ -175,7 +175,7 @@
                        );
        if(cval->run_mode == GIMP_RUN_INTERACTIVE)
        {
-         g_message(l_msg);
+         g_message("%s", l_msg);
            }
        g_free(l_msg);
        return -1;
--- a/vid_common/gap_cme_gui.c
+++ b/vid_common/gap_cme_gui.c
@@ -2035,7 +2035,7 @@
                          , (int)(gpp->val.vid_width / 16) * 16
                          , (int)(gpp->val.vid_height / 16) * 16
                          );
-      g_message(l_msg);
+      g_message("%s", l_msg);
       g_free(l_msg);
       return (FALSE);
     }
@@ -2058,7 +2058,7 @@
                             , (int)bits
                             , gpp->val.audioname1
                             );
-         g_message(l_msg);
+         g_message("%s", l_msg);
          g_free(l_msg);
          return (FALSE);
        }
@@ -2077,7 +2077,7 @@
                             "file: %s\n")
                             , gpp->val.audioname1
                             );
-         g_message(l_msg);
+         g_message("%s", l_msg);
          g_free(l_msg);
          return (FALSE);
     }
@@ -2101,7 +2101,7 @@
                                 "supported rates: \n"
                                 " 22050, 24000, 32000, 44100, 48000")
                                 , (int)gpp->val.samplerate);
-             g_message(l_msg);
+             g_message("%s", l_msg);
              g_free(l_msg);
              return (FALSE);
              break;
@@ -2129,7 +2129,7 @@
                                 "supported rates:\n"
                                 " 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000")
                                 , (int)gpp->val.samplerate);
-             g_message(l_msg);
+             g_message("%s", l_msg);
              g_free(l_msg);
              return (FALSE);
              break;
@@ -3929,7 +3929,7 @@
      l_msg = g_strdup_printf(_("Required Plugin %s not available"), gpp->val.ecp_sel.vid_enc_plugin);
      if(gpp->val.run_mode == GIMP_RUN_INTERACTIVE)
      {
-       g_message(l_msg);
+       g_message("%s", l_msg);
      }
      g_free(l_msg);
      return -1;
@@ -3981,7 +3981,7 @@
      l_msg = g_strdup_printf(_("Call of Required Plugin %s failed"), gpp->val.ecp_sel.vid_enc_plugin);
      if(gpp->val.run_mode == GIMP_RUN_INTERACTIVE)
      {
-       g_message(l_msg);
+       g_message("%s", l_msg);
      }
      g_free(l_msg);
   }
