[corrida] Fix build with -Werror=format-security
Lubomir Rintel
lkundrak at fedoraproject.org
Wed Dec 4 22:43:42 UTC 2013
commit 53ce4ff9c8040fa8e2112ffa892cff599d347f1d
Author: Lubomir Rintel <lkundrak at v3.sk>
Date: Wed Dec 4 23:43:37 2013 +0100
Fix build with -Werror=format-security
corrida-0.96-11-formatsec.patch | 35 +++++++++++++++++++++++++++++++++++
corrida.spec | 8 +++++++-
2 files changed, 42 insertions(+), 1 deletions(-)
---
diff --git a/corrida-0.96-11-formatsec.patch b/corrida-0.96-11-formatsec.patch
new file mode 100644
index 0000000..c0c75cb
--- /dev/null
+++ b/corrida-0.96-11-formatsec.patch
@@ -0,0 +1,35 @@
+From c539d49d06fea9c6a9efb4e684a8837b82889f7f Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak at v3.sk>
+Date: Wed, 4 Dec 2013 23:16:52 +0100
+Subject: [PATCH] Fix build with -Werror=format-security
+
+Fedora, starting with version 21, will enable this flag in order to limit
+potentially insecure uses of format strings. It is required for format strings
+to be constant now.
+---
+ corrida/console.c | 11 +----------
+ 1 file changed, 1 insertion(+), 10 deletions(-)
+
+diff --git a/corrida/console.c b/corrida/console.c
+index 29acc3b..de35b69 100644
+--- a/corrida/console.c
++++ b/corrida/console.c
+@@ -15,14 +15,5 @@ void corrida_printf( char *message )
+
+ void console_printf( char *message )
+ {
+- gboolean corrida_printf_switch = TRUE;
+- char string[MAX_CORRIDA_STRLEN];
+-
+- if (corrida_printf_switch == TRUE) {
+- strcpy (string, APPLICATION_NAME);
+- strcat (string, ": ");
+- strcat (string, message);
+- strcat (string, "\n");
+- printf (string);
+- }
++ printf (APPLICATION_NAME ": %s\n", message);
+ }
+--
+1.8.4.2
+
diff --git a/corrida.spec b/corrida.spec
index 79e4e8e..fc11366 100644
--- a/corrida.spec
+++ b/corrida.spec
@@ -3,7 +3,7 @@
Name: corrida
Version: %{version_major}.%{version_minor}
-Release: 13%{?dist}
+Release: 14%{?dist}
Summary: Application for archivation of meteor observations
Group: Amusements/Graphics
@@ -12,6 +12,8 @@ URL: http://corrida.pkim.org/
Source0: http://corrida.pkim.org/releases/corrida-%{version_major}-%{version_minor}.tar.gz
Source1: corrida.desktop
Patch0: corrida-0.96-11-count.patch
+# Sent by e-mail to jurmcc at gmail.com
+Patch1: corrida-0.96-11-formatsec.patch
BuildRequires: gtk2-devel
BuildRequires: ImageMagick
@@ -25,6 +27,7 @@ archivation of meteor observations.
%prep
%setup -q -n corrida-%{version_major}-%{version_minor}
%patch0 -p1 -b .count
+%patch1 -p1 -b .formatsec
%build
@@ -57,6 +60,9 @@ desktop-file-install %{SOURCE1} \
%changelog
+* Wed Dec 04 2013 Lubomir Rintel <lkundrak at v3.sk> - 0.96.11-14
+- Fix build with -Werror=format-security
+
* Thu Oct 24 2013 Lubomir Rintel <lkundrak at v3.sk> - 0.96.11-13
- Bulk sad and useless attempt at consistent SPEC file formatting
More information about the scm-commits
mailing list