[packages/sharutils] - fix format string warnings

baggins baggins at pld-linux.org
Thu Dec 13 13:51:29 CET 2012


commit c1c135f06766ba15a6b0395a7aa28e917212ff75
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Dec 13 13:51:19 2012 +0100

    - fix format string warnings

 format-security.patch | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++
 sharutils.spec        |  2 ++
 2 files changed, 58 insertions(+)
---
diff --git a/sharutils.spec b/sharutils.spec
index d381d00..8d9e9bb 100644
--- a/sharutils.spec
+++ b/sharutils.spec
@@ -18,6 +18,7 @@ Source1:	http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-ma
 # Source1-md5:	336f405f69324d129a6ccd3b66f8eb6c
 Patch0:		%{name}-info.patch
 Patch1:		%{name}-glibc2.16.patch
+Patch2:		format-security.patch
 URL:		http://www.gnu.org/software/sharutils/
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake >= 1:1.11
@@ -91,6 +92,7 @@ programlar üzerinden güvenli bir şekilde gönderilebilir.
 %setup -q -a1
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %{__rm} po/stamp-po
 
diff --git a/format-security.patch b/format-security.patch
new file mode 100644
index 0000000..d08b5a8
--- /dev/null
+++ b/format-security.patch
@@ -0,0 +1,56 @@
+--- sharutils-4.11.1/src/unshar.c~	2011-01-15 02:39:02.000000000 +0100
++++ sharutils-4.11.1/src/unshar.c	2012-12-13 13:49:48.998719358 +0100
+@@ -453,7 +453,7 @@
+               strcpy (cp, arg);
+             }
+           if (file = fopen (name_buffer, "r"), !file)
+-            error (EXIT_FAILURE, errno, name_buffer);
++            error (EXIT_FAILURE, errno, "%s", name_buffer);
+           unarchive_shar_file (name_buffer, file);
+           fclose (file);
+         }
+@@ -511,13 +511,13 @@
+   {
+     int fd = mkstemp (pz_fname);
+     if (fd < 0)
+-      error (EXIT_FAILURE, errno, pz_fname);
++      error (EXIT_FAILURE, errno, "%s", pz_fname);
+ 
+     fp = fdopen (fd, "w+");
+   }
+ 
+   if (fp == NULL)
+-    error (EXIT_FAILURE, errno, pz_fname);
++    error (EXIT_FAILURE, errno, "%s", pz_fname);
+ 
+   {
+     char *buf = malloc (pg_sz);
+--- sharutils-4.11.1/src/shar.c~	2011-01-15 02:38:38.000000000 +0100
++++ sharutils-4.11.1/src/shar.c	2012-12-13 13:50:22.712051502 +0100
+@@ -513,7 +513,7 @@
+ 
+   if (stat (local_name, &struct_stat))
+     {
+-      error (0, errno, local_name);
++      error (0, errno, "%s", local_name);
+       return 1;
+     }
+ 
+@@ -522,7 +522,7 @@
+ 
+   if (directory = opendir (local_name), !directory)
+     {
+-      error (0, errno, local_name);
++      error (0, errno, "%s", local_name);
+       return 1;
+     }
+ 
+@@ -615,7 +615,7 @@
+ #else
+   if (closedir (directory))
+     {
+-      error (0, errno, local_name);
++      error (0, errno, "%s", local_name);
+       return 1;
+     }
+ #endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/sharutils.git/commitdiff/c1c135f06766ba15a6b0395a7aa28e917212ff75



More information about the pld-cvs-commit mailing list