[lincity-ng] format security fixes
Tom Callaway
spot at fedoraproject.org
Tue Dec 3 21:04:12 UTC 2013
commit 6b1f6db180ccd0806b789c8a8299ca02037659e6
Author: Tom Callaway <spot at fedoraproject.org>
Date: Tue Dec 3 16:04:07 2013 -0500
format security fixes
lincity-ng-2.0-format-security-fixes.patch | 24 ++++++++++++++++++++++++
lincity-ng.spec | 7 ++++++-
2 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/lincity-ng-2.0-format-security-fixes.patch b/lincity-ng-2.0-format-security-fixes.patch
new file mode 100644
index 0000000..262fb0a
--- /dev/null
+++ b/lincity-ng-2.0-format-security-fixes.patch
@@ -0,0 +1,24 @@
+diff -up lincity-ng-2.0/src/lincity-ng/Dialog.cpp.format-security lincity-ng-2.0/src/lincity-ng/Dialog.cpp
+--- lincity-ng-2.0/src/lincity-ng/Dialog.cpp.format-security 2013-12-03 15:58:59.522973839 -0500
++++ lincity-ng-2.0/src/lincity-ng/Dialog.cpp 2013-12-03 15:59:31.057936550 -0500
+@@ -378,7 +378,7 @@ void Dialog::gameStats(){
+ setParagraphN( "statistic_text", line++, outf );
+ }
+ if (sustain_flag){
+- snprintf (outf, maxlength, _("Economy is sustainable"));
++ snprintf (outf, maxlength, "%s", _("Economy is sustainable"));
+ setParagraphN( "statistic_text", line++, outf );
+ }
+ snprintf (outf, maxlength, _("Population %d of which %d are not housed.")
+diff -up lincity-ng-2.0/src/lincity/fileutil.cpp.format-security lincity-ng-2.0/src/lincity/fileutil.cpp
+--- lincity-ng-2.0/src/lincity/fileutil.cpp.format-security 2013-12-03 15:58:01.647042186 -0500
++++ lincity-ng-2.0/src/lincity/fileutil.cpp 2013-12-03 15:58:44.002992179 -0500
+@@ -498,7 +498,7 @@ void check_savedir(void)
+
+ void malloc_failure(void)
+ {
+- printf(_("Out of memory: malloc failure\n"));
++ printf("%s", _("Out of memory: malloc failure\n"));
+ exit(1);
+ }
+
diff --git a/lincity-ng.spec b/lincity-ng.spec
index 7b6d554..c9ba3b4 100644
--- a/lincity-ng.spec
+++ b/lincity-ng.spec
@@ -2,12 +2,13 @@
Name: lincity-ng
Version: 2.0
-Release: 13%{?dist}
+Release: 14%{?dist}
License: GPLv2+
Group: Amusements/Games
Summary: City Simulation Game
URL: http://lincity-ng.berlios.de/
Source0: http://download.berlios.de/lincity-ng/lincity-ng-%{version}.tar.bz2
+Patch0: lincity-ng-2.0-format-security-fixes.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: jam, physfs-devel, zlib-devel, libxml2-devel
BuildRequires: SDL-devel, SDL_mixer-devel, SDL_image-devel, SDL_gfx-devel
@@ -35,6 +36,7 @@ play Lincity-NG.
%prep
%setup -q -n %{name}-%{version}
+%patch0 -p1 -b .format-security
sed -i "s/CFLAGS += -O3 -g -Wall/CFLAGS += $RPM_OPT_FLAGS/" Jamrules
sed -i "s/CXXFLAGS += -O3 -g -Wall/CXXFLAGS += $RPM_OPT_FLAGS/" Jamrules
sed -i 's|lincity-ng.png|lincity-ng|g' lincity-ng.desktop
@@ -72,6 +74,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/lincity-ng/
%changelog
+* Tue Dec 3 2013 Tom Callaway <spot at fedoraproject.org> - 2.0-14
+- fix format-security issues
+
* Sat Nov 9 2013 Ville Skyttä <ville.skytta at iki.fi> - 2.0-13
- Install docs to %%{_pkgdocdir} where available (#993856).
More information about the scm-commits
mailing list