[dev86] Add -Werror=format-security build fix

Lubomir Rintel lkundrak at fedoraproject.org
Fri Nov 29 18:11:11 UTC 2013


commit 82897d23f46219d644e89b9febde7508c7938af9
Author: Lubomir Rintel <lkundrak at v3.sk>
Date:   Fri Nov 29 19:10:33 2013 +0100

    Add -Werror=format-security build fix

 dev86-format.patch |   44 ++++++++++++++++++++++++++++++++++++++++++++
 dev86.spec         |    7 ++++++-
 2 files changed, 50 insertions(+), 1 deletions(-)
---
diff --git a/dev86-format.patch b/dev86-format.patch
new file mode 100644
index 0000000..a5d20f3
--- /dev/null
+++ b/dev86-format.patch
@@ -0,0 +1,44 @@
+From 7562873999e7cae31ab656f894b7c06d015a0881 Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak at v3.sk>
+Date: Thu, 28 Nov 2013 09:13:17 +0100
+Subject: [PATCH] Fix format string use
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+copt.c: In function ‘writeoutf’:
+copt.c:806:2: error: format not a string literal and no format arguments [-Werror=format-security]
+  fprintf(fp, headstr);
+---
+ copt/copt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/copt/copt.c b/copt/copt.c
+index 9392380..fe49ad5 100644
+--- a/copt/copt.c
++++ b/copt/copt.c
+@@ -803,7 +803,7 @@ static void writeoutf(char *filename, char *headstr)
+ 	exit(1);
+   }
+   if (headstr != NULL) {
+-	fprintf(fp, headstr);
++	fprintf(fp, "%s", headstr);
+ 	fprintf(fp, "\n");
+   }
+   for (lp = infile; lp != NULL; lp = lp->next)
+-- 
+1.8.4.2
+
+diff --git a/ar/ar.c b/ar/ar.c
+index 4e5cb0a..f808a3a 100644
+--- a/ar/ar.c
++++ b/ar/ar.c
+@@ -2036,7 +2036,7 @@ error_with_file (string, mapelt)
+      struct mapelt *mapelt;
+ {
+   fprintf (stderr, "%s: ", program_name);
+-  fprintf (stderr, string);
++  fprintf (stderr, "%s", string);
+   if (mapelt->info.offset != 0)
+     fprintf (stderr, "%s(%s)", archive, mapelt->info.name);
+   else
diff --git a/dev86.spec b/dev86.spec
index 64aa1ed..25d0302 100644
--- a/dev86.spec
+++ b/dev86.spec
@@ -1,7 +1,7 @@
 Summary: A real mode 80x86 assembler and linker
 Name: dev86
 Version: 0.16.20
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPL+ and GPLv2+ and LGPLv2+
 Group: Development/Languages
 URL: http://v3.sk/~lkundrak/dev86/
@@ -10,6 +10,7 @@ Patch0: dev86-noelks.patch
 Patch1: dev86-64bit.patch
 Patch2: dev86-nostrip.patch
 Patch4: dev86-long.patch
+Patch5: dev86-format.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Obsoletes: bin86
 
@@ -33,6 +34,7 @@ mode from their source code.
 %endif
 %patch2 -p1 -b .nostrip
 %patch4 -p1 -b .long
+%patch5 -p1 -b .format
 
 %build
 # the main makefile doesn't allow parallel build
@@ -85,6 +87,9 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_mandir}/man1/*
 
 %changelog
+* Tue Oct 29 2013 Lubomir Rintel <lkundrak at v3.sk> 0.16.20-2
+- Add -Werror=format-security build fix
+
 * Tue Oct 29 2013 Lubomir Rintel <lkundrak at v3.sk> 0.16.20-1
 - update to 0.16.20
 


More information about the scm-commits mailing list