[ccgo] Pass compilation with -Wformat-security
Petr Pisar
ppisar at fedoraproject.org
Tue Dec 3 13:15:04 UTC 2013
commit 8c3f11bd3d182c80bfa40d4c4517e89f7cc7d613
Author: Petr Písař <ppisar at redhat.com>
Date: Tue Dec 3 14:09:16 2013 +0100
Pass compilation with -Wformat-security
....4-Pass-compilation-with-Wformat-security.patch | 45 ++++++++++++++++++++
ccgo.spec | 8 +++-
2 files changed, 52 insertions(+), 1 deletions(-)
---
diff --git a/ccgo-0.3.6.4-Pass-compilation-with-Wformat-security.patch b/ccgo-0.3.6.4-Pass-compilation-with-Wformat-security.patch
new file mode 100644
index 0000000..cb55bd0
--- /dev/null
+++ b/ccgo-0.3.6.4-Pass-compilation-with-Wformat-security.patch
@@ -0,0 +1,45 @@
+From ee758b61cac0364eb0b759e769c8e675a9664acd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Tue, 3 Dec 2013 14:00:32 +0100
+Subject: [PATCH] Pass compilation with -Wformat-security
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+<https://bugzilla.redhat.com/show_bug.cgi?id=1037009>
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+---
+ igs/board.cc | 2 +-
+ igs/player_list.cc | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/igs/board.cc b/igs/board.cc
+index 19f092e..17cd8d9 100644
+--- a/igs/board.cc
++++ b/igs/board.cc
+@@ -50,7 +50,7 @@ Glib::ustring Board::Record::to_str() const
+ char buf[100];
+ if (stop == STOP_DISCONNECT) snprintf(buf, 100, _("%s disconnected from the game.").c_str(), w.c_str());
+ else if (stop == STOP_ADJOURN) snprintf(buf, 100, _("%s adjourned the game.").c_str(), w.c_str());
+- else snprintf(buf, 100, _("The game is not marked.").c_str());
++ else snprintf(buf, 100, "%s", _("The game is not marked.").c_str());
+ return buf;
+ }
+
+diff --git a/igs/player_list.cc b/igs/player_list.cc
+index f19e2c2..25c9421 100644
+--- a/igs/player_list.cc
++++ b/igs/player_list.cc
+@@ -748,7 +748,7 @@ void PlayerList::add_stored(const std::vector<Storage> & r)
+ text_area.get_buffer()->insert(text_area.get_buffer()->end(), "\n");
+ char buf[100];
+ if (r.size() > 1) snprintf(buf, 100, _("%d stored games").c_str(), r.size());
+- else snprintf(buf, 100, _("one stored game").c_str());
++ else snprintf(buf, 100, "%s", _("one stored game").c_str());
+ text_area.get_buffer()->insert(text_area.get_buffer()->end(), buf);
+ text_area.get_buffer()->insert(text_area.get_buffer()->end(), "\n");
+ if (at_bottom) {
+--
+1.8.3.1
+
diff --git a/ccgo.spec b/ccgo.spec
index 1b1ad86..60fe7ef 100644
--- a/ccgo.spec
+++ b/ccgo.spec
@@ -1,11 +1,13 @@
Name: ccgo
Version: 0.3.6.4
-Release: 9%{?dist}
+Release: 10%{?dist}
Summary: An IGS (Internet Go Server) client written in C++
Group: Amusements/Games
License: GPLv3+
URL: http://ccdw.org/~cjj/prog/%{name}/
Source0: %{url}src/%{name}-%{version}.tar.gz
+# Pass compilation with -Wformat-security, bug #1037009
+Patch0: %{name}-0.3.6.4-Pass-compilation-with-Wformat-security.patch
BuildRequires: gettext, gconfmm26-devel, gtkmm24-devel, pkgconfig
BuildRequires: desktop-file-utils
# Update config.sub to support aarch64, bug #925132
@@ -20,6 +22,7 @@ on an Internet Go Server (IGS) on the Internet. It supports smart game format
%prep
%setup -q
+%patch0 -p1 -b .warning
# Make XDG desktop file compliant
sed -i -e '/^Encoding/d' -e '/^Categories/s/Application;//' %{name}.desktop.in
# Update config.sub to support aarch64, bug #925132
@@ -42,6 +45,9 @@ make install DESTDIR=$RPM_BUILD_ROOT
%doc AUTHORS COPYING README
%changelog
+* Tue Dec 03 2013 Petr Pisar <ppisar at redhat.com> - 0.3.6.4-10
+- Pass compilation with -Wformat-security (bug #1037009)
+
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3.6.4-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
More information about the scm-commits
mailing list