summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTupone Alfredo <tupone@gentoo.org>2015-10-28 13:29:54 +0100
committerTupone Alfredo <tupone@gentoo.org>2015-10-28 13:30:10 +0100
commitcd699b6b53a171ea727bddd3c73298339fd70b74 (patch)
tree3f6bbae9a15fb1551dc6419f8cbdbf17c2504ac0 /games-simulation
parentsci-physics/lammps: Add python-3.4 support to latest version. (diff)
downloadgentoo-cd699b6b53a171ea727bddd3c73298339fd70b74.tar.gz
gentoo-cd699b6b53a171ea727bddd3c73298339fd70b74.tar.bz2
gentoo-cd699b6b53a171ea727bddd3c73298339fd70b74.zip
games-simulation/pmars-sdl: compile with format-security. Bug #544358
Package-Manager: portage-2.2.20.1
Diffstat (limited to 'games-simulation')
-rw-r--r--games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-format.patch65
-rw-r--r--games-simulation/pmars-sdl/pmars-sdl-0.9.2e.ebuild6
2 files changed, 70 insertions, 1 deletions
diff --git a/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-format.patch b/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-format.patch
new file mode 100644
index 000000000000..d8c588a32206
--- /dev/null
+++ b/games-simulation/pmars-sdl/files/pmars-sdl-0.9.2e-format.patch
@@ -0,0 +1,65 @@
+--- src/asm.c.old 2015-10-28 13:23:53.465014342 +0100
++++ src/asm.c 2015-10-28 13:23:10.502813377 +0100
+@@ -652,7 +652,7 @@
+ macputs(str);
+ #else
+ if (!inCdb)
+- fprintf(stderr, str);
++ fprintf(stderr, "%s", str);
+ #if defined DOSALLGRAPHX
+ else {
+ if (displayMode == TEXT)
+@@ -833,7 +833,7 @@
+ #ifdef __MAC__
+ textout(notEnoughMemErr);
+ #else
+- fprintf(stderr, notEnoughMemErr);
++ fprintf(stderr, "%s", notEnoughMemErr);
+ #endif
+ Exit(MEMERR);
+ break;
+@@ -916,7 +916,7 @@
+ }
+
+ if (ierr >= ERRMAX) {
+- sprintf(outs, tooManyMsgErr);
++ sprintf(outs, "%s", tooManyMsgErr);
+ #ifndef VMS
+ textout(outs);
+ #else
+--- src/cdb.c.old 2015-10-28 13:24:04.669805966 +0100
++++ src/cdb.c 2015-10-28 13:23:10.502813377 +0100
+@@ -2760,7 +2760,7 @@
+ fprintf(outp, nameByAuthorScores, warrior[idxV[i]].name, warrior[idxV[i]].authorName,
+ scrV[idxV[i]]);
+ if (warriors > 2) {
+- fprintf(outp, resultsAre);
++ fprintf(outp, "%s", resultsAre);
+ for (j = 0; j < warriors; ++j) {
+ fprintf(outp, " %d", warrior[idxV[i]].score[j]);
+ }
+--- src/clparse.c.old 2015-10-28 13:24:10.648694768 +0100
++++ src/clparse.c 2015-10-28 13:23:10.502813377 +0100
+@@ -289,7 +289,7 @@
+ if (next_input(filep, inputs)) {
+ if (!strcmp(inputs, "-")) {
+ newFile = stdin;
+- fprintf(stderr, readingStdin);
++ fprintf(stderr, "%s", readingStdin);
+ } else {
+ if ((newFile = fopen(inputs, "r")) == NULL) {
+ code = FILENAME; /* command file not found */
+@@ -430,11 +430,11 @@
+ errout(outs);
+ break;
+ case MEMORY:
+- sprintf(outs, outOfMemory);
++ sprintf(outs, "%s", outOfMemory);
+ errout(outs);
+ break;
+ case FILENAME:
+- sprintf(outs, cannotOpenParameterFile);
++ sprintf(outs, "%s", cannotOpenParameterFile);
+ errout(outs);
+ break;
+ }
diff --git a/games-simulation/pmars-sdl/pmars-sdl-0.9.2e.ebuild b/games-simulation/pmars-sdl/pmars-sdl-0.9.2e.ebuild
index 3efe83a1c9d5..3429dd0f2a9d 100644
--- a/games-simulation/pmars-sdl/pmars-sdl-0.9.2e.ebuild
+++ b/games-simulation/pmars-sdl/pmars-sdl-0.9.2e.ebuild
@@ -3,7 +3,7 @@
# $Id$
EAPI=5
-inherit toolchain-funcs games
+inherit toolchain-funcs games eutils
MY_PN="${PN/-sdl/}"
MY_PV="${PV/e/-5}"
@@ -24,6 +24,10 @@ DEPEND="sdl? ( x11-libs/libX11 media-libs/libsdl[video] )
S=${WORKDIR}/${MY_P}
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-format.patch
+}
+
src_compile() {
CFLAGS="${CFLAGS} -DEXT94 -DPERMUTATE"
LFLAGS="-x"