bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sharutils does not build with -Werror=format-security


From: Santiago Vila
Subject: sharutils does not build with -Werror=format-security
Date: Sat, 12 Oct 2013 17:21:46 +0200 (CEST)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)

Hello.

The following patch is required to allow compilation of
sharutils 4.13.5 with -Werror=format-security.

Thanks.


From: Simon Ruderich <address@hidden>
Subject: Allow compilation with -Werror=format-security
Bug-Debian: http://bugs.debian.org/700313
X-Debian-version: 1:4.11.1-2

--- a/src/shar.c
+++ b/src/shar.c
@@ -461,7 +461,7 @@
 
   if (stat (local_name, &struct_stat))
     {
-      error (0, errno, local_name);
+      error (0, errno, "%s", local_name);
       return SHAR_EXIT_FILE_NOT_FOUND;
     }
 
@@ -470,7 +470,7 @@
 
   if (directory = opendir (local_name), !directory)
     {
-      error (0, errno, local_name);
+      error (0, errno, "%s", local_name);
       return SHAR_EXIT_CANNOT_OPENDIR;
     }
 
@@ -563,7 +563,7 @@
 #else
   if (closedir (directory))
     {
-      error (0, errno, local_name);
+      error (0, errno, "%s", local_name);
       return SHAR_EXIT_CANNOT_OPENDIR;
     }
 #endif
@@ -954,7 +954,7 @@
         free (c_dir);
       }
     else
-      error (0, errno, _("Cannot get current directory name"));
+      error (0, errno, "%s", _("Cannot get current directory name"));
   }
 }
 
@@ -2134,7 +2134,7 @@
        */
       FILE * fp = freopen ("/dev/null", fwriteonly_mode, stderr);
       if (fp != stderr)
-        error (SHAR_EXIT_FAILED, errno,
+        error (SHAR_EXIT_FAILED, errno, "%s",
                _("reopening stderr to /dev/null"));
     }
 
@@ -2200,7 +2200,7 @@
   if (HAVE_OPT(QUERY_USER))
     {
       if (HAVE_OPT(NET_HEADERS))
-       error (0, 0, _("PLEASE avoid -X shars on Usenet or public networks"));
+       error (0, 0, "%s", _("PLEASE avoid -X shars on Usenet or public 
networks"));
 
       fputs ("shar_wish=\n", output);
     }
@@ -2348,7 +2348,7 @@
               optionLoadLine (&sharOptions, arg);
             }
           else
-            error (0, errno, arg);
+            error (0, errno, "%s", arg);
           continue;
         }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]