[abe] Add -format-security patch.
Jerry James
jjames at fedoraproject.org
Wed Nov 20 22:23:11 UTC 2013
commit 9a8375a5567ba6642773756f0c63ffa233200594
Author: Jerry James <jamesjer at betterlinux.com>
Date: Wed Nov 20 15:23:32 2013 -0700
Add -format-security patch.
abe-format-security.patch | 87 +++++++++++++++++++++++++++++++++++++++++++++
abe.spec | 9 ++++-
2 files changed, 95 insertions(+), 1 deletions(-)
---
diff --git a/abe-format-security.patch b/abe-format-security.patch
new file mode 100644
index 0000000..ad88b4b
--- /dev/null
+++ b/abe-format-security.patch
@@ -0,0 +1,87 @@
+--- ./src/Game.c.orig 2005-03-05 09:20:04.000000000 -0700
++++ ./src/Game.c 2013-11-20 12:30:00.000000000 -0700
+@@ -6,21 +6,14 @@ Game game;
+
+ // path_sprintf should not be used by other .c files, as it does not fit for them.
+ static void
+-path_sprintf(char *path, char *formatted_name, int version)
++path_sprintf(char *path, const char *name, int version)
+ {
+-
+- int len;
+-
+- printf("path_sprintf (%p, %s, %d)\n", path, formatted_name, version);
+-
+- strcpy(path, getSaveGameDir());
+-
+- len = strlen(path);
+-
+ if(1 == version) {
+- sprintf(path + len, formatted_name);
++ printf("path_sprintf (%p, %s.dat, %d)\n", path, name, version);
++ sprintf(path, "%s%s.dat", getSaveGameDir(), name);
+ } else {
+- sprintf(path + len, formatted_name, version);
++ printf("path_sprintf (%p, %s%d.dat, %d)\n", path, name, version, version);
++ sprintf(path, "%s%s%d.dat", getSaveGameDir(), name, version);
+ }
+
+ }
+@@ -30,14 +23,14 @@ deleteSavedGame()
+ {
+ char path[PATH_SIZE];
+ // version 2
+- path_sprintf(path, "save%d.dat", GAME_VERSION);
++ path_sprintf(path, "save", GAME_VERSION);
+ remove(path);
+- path_sprintf(path, "savedmap%d.dat", GAME_VERSION);
++ path_sprintf(path, "savedmap", GAME_VERSION);
+ remove(path);
+ // version 1
+- path_sprintf(path, "save.dat", 1);
++ path_sprintf(path, "save", 1);
+ remove(path);
+- path_sprintf(path, "savedmap.dat", 1);
++ path_sprintf(path, "savedmap", 1);
+ remove(path);
+ }
+
+@@ -51,7 +44,7 @@ saveGame()
+
+ mkshuae();
+
+- path_sprintf(path, "save%d.dat", GAME_VERSION);
++ path_sprintf(path, "save", GAME_VERSION);
+
+ if(!(fp = fopen(path, "wb"))) {
+ err = strerror(errno);
+@@ -79,7 +72,7 @@ saveGame()
+ SDL_RWclose(rwop);
+
+ // save the map
+- path_sprintf(path, "savedmap%d.dat", GAME_VERSION);
++ path_sprintf(path, "savedmap", GAME_VERSION);
+ saveMapPath(path);
+ }
+
+@@ -96,7 +89,7 @@ loadGame()
+ version = (int) GAME_VERSION;
+
+ // load the map
+- path_sprintf(path, "savedmap%d.dat", GAME_VERSION);
++ path_sprintf(path, "savedmap", GAME_VERSION);
+ if(!loadMapPath(path, 0)) {
+ // if can't find saved map load static map
+ fprintf(stderr,
+@@ -112,9 +105,9 @@ loadGame()
+ // try to find a saved game of any version
+ while(version > 0) {
+ if(version > 1) {
+- path_sprintf(path, "save%d.dat", version);
++ path_sprintf(path, "save", version);
+ } else { // By Pedro: version==1
+- path_sprintf(path, "save.dat", version);
++ path_sprintf(path, "save", version);
+ }
+ fprintf(stderr, "Trying to load saved game: %s\n", path);
+ fflush(stderr);
diff --git a/abe.spec b/abe.spec
index 9e7ef75..2826d69 100644
--- a/abe.spec
+++ b/abe.spec
@@ -1,6 +1,6 @@
Name: abe
Version: 1.1
-Release: 20%{?dist}
+Release: 21%{?dist}
Summary: Scrolling, platform-jumping, ancient pyramid exploring game
Group: Amusements/Games
@@ -21,6 +21,8 @@ Patch2: %{name}-1.1-format.patch
# Add support for aarch64. Sent upstream 25 Mar 2013:
# https://sourceforge.net/tracker/?func=detail&aid=3609029&group_id=70141&atid=526743
Patch3: %{name}-1.1-aarch64.patch
+# Fix build failure with -Werror=format-security
+Patch4: %{name}-1.1-format-security.patch
BuildRequires: SDL-devel >= 1.2.3, SDL_mixer-devel >= 1.2.3
BuildRequires: libXmu-devel libXi-devel
@@ -35,6 +37,8 @@ vaguely in the style of similar games for the Commodore+4.
%patch0
%patch1
%patch2
+%patch3
+%patch4
# Fix the FSF's address
sed 's/59 Temple Place, Suite 330, Boston, MA 02111-1307/51 Franklin Street, Suite 500, Boston, MA 02110-1335/' COPYING > COPYING.new
@@ -88,6 +92,9 @@ fi
%{_datadir}/pixmaps/%{name}.png
%changelog
+* Wed Nov 20 2013 Jerry James <loganjerry at gmail.com> - 1.1-21
+- Add -format-security patch
+
* Fri Nov 8 2013 Jerry James <loganjerry at gmail.com> - 1.1-20
- Add an AppData file
More information about the scm-commits
mailing list