From c86a999f74ca6e29aa84eb72602f8081001629f2 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Fri, 19 Aug 2016 21:28:30 +0200 Subject: [PATCH] Fix a format string vulnerability --- Source/g_game.c | 2 +- Source/m_misc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/g_game.c b/Source/g_game.c index b917dff1..b904b5ac 100644 --- a/Source/g_game.c +++ b/Source/g_game.c @@ -1276,7 +1276,7 @@ static void G_DoSaveGame(void) Z_CheckHeap(); if (!M_WriteFile(name, savebuffer, length)) - dprintf(errno ? strerror(errno) : "Could not save game: Error unknown"); + dprintf("%s", errno ? strerror(errno) : "Could not save game: Error unknown"); else players[consoleplayer].message = s_GGSAVED; // Ty 03/27/98 - externalized diff --git a/Source/m_misc.c b/Source/m_misc.c index db351fac..e2417c46 100644 --- a/Source/m_misc.c +++ b/Source/m_misc.c @@ -2399,7 +2399,7 @@ void M_ScreenShot (void) // players[consoleplayer].message = "screen shot" // killough 10/98: print error message and change sound effect if error - S_StartSound(NULL, !success ? dprintf(errno ? strerror(errno) : + S_StartSound(NULL, !success ? dprintf("%s", errno ? strerror(errno) : "Could not take screenshot"), sfx_oof : gamemode==commercial ? sfx_radio : sfx_tink);