From: Tupone Alfredo Date: Mon, 4 Jan 2016 15:01:23 +0000 (+0100) Subject: games-strategy/galaxyhack: Build with -Wformat-security. Bug #57069 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=f2c4d6d57a2f38769508dffbc5a5adf86c6ec0b6;p=gentoo.git games-strategy/galaxyhack: Build with -Wformat-security. Bug #57069 Package-Manager: portage-2.2.24 --- diff --git a/games-strategy/galaxyhack/files/galaxyhack-1.74-format.patch b/games-strategy/galaxyhack/files/galaxyhack-1.74-format.patch new file mode 100644 index 000000000000..4bd9e8fc6f83 --- /dev/null +++ b/games-strategy/galaxyhack/files/galaxyhack-1.74-format.patch @@ -0,0 +1,64 @@ +--- JSDL.cpp.old 2016-01-04 10:42:56.404316856 +0100 ++++ JSDL.cpp 2016-01-04 10:51:16.744255312 +0100 +@@ -47,14 +47,14 @@ + if (!globalSettings.batch) { + if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO) == -1) { + char output[120]; +- sprintf(output, SDL_GetError()); ++ strcpy(output, SDL_GetError()); + throw runtime_error(output); + } + + if (!globalSettings.disableSound) { + if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) { + char error[120]; +- sprintf(error, SDL_GetError()); ++ strcpy(error, SDL_GetError()); + string errorStr = error; + errorStr += ", continuing without initialising sound."; + WriteLog(errorStr); +@@ -81,7 +81,7 @@ + //4096 is rather a large chunksize, should be smaller if I add sound effects + if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 4096) == -1) { + char output[100]; +- sprintf(output, Mix_GetError()); ++ strcpy(output, Mix_GetError()); + throw runtime_error(output); + } + } +@@ -101,7 +101,7 @@ + if (screen == NULL) { + SDL_Quit(); + char output[120]; +- sprintf(output, SDL_GetError()); ++ strcpy(output, SDL_GetError()); + throw runtime_error(output); + } + } +@@ -114,7 +114,7 @@ + + if (loadingSurface == NULL) { + char output[100]; +- sprintf(output, IMG_GetError()); ++ strcpy(output, IMG_GetError()); + throw runtime_error(output); + } + +@@ -308,7 +308,7 @@ + + if (!theMusic) { + char output[100]; +- sprintf(output, Mix_GetError()); ++ strcpy(output, Mix_GetError()); + throw runtime_error(output); + } + } +@@ -319,7 +319,7 @@ + + if (Mix_PlayMusic(theMusic, -1) == -1) { + char output[100]; +- sprintf(output, Mix_GetError()); ++ strcpy(output, Mix_GetError()); + throw runtime_error(output); + } + } diff --git a/games-strategy/galaxyhack/galaxyhack-1.74.ebuild b/games-strategy/galaxyhack/galaxyhack-1.74.ebuild index a85b75536e96..f19966e98676 100644 --- a/games-strategy/galaxyhack/galaxyhack-1.74.ebuild +++ b/games-strategy/galaxyhack/galaxyhack-1.74.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -30,6 +30,7 @@ src_prepare() { "${FILESDIR}"/${P}-boost.patch \ "${FILESDIR}"/${P}-gcc43.patch \ "${FILESDIR}"/${P}-boost-1.50.patch \ + "${FILESDIR}"/${P}-format.patch \ "${FILESDIR}"/${P}-gentoo.patch sed -i "s:@GAMES_DATADIR@:${GAMES_DATADIR}:" \ Main.cpp || die