Fix a format string vulnerability

This commit is contained in:
Fabian Greffrath 2016-08-19 21:28:30 +02:00
parent 70a0d74de2
commit c86a999f74
2 changed files with 2 additions and 2 deletions

View File

@ -1276,7 +1276,7 @@ static void G_DoSaveGame(void)
Z_CheckHeap(); Z_CheckHeap();
if (!M_WriteFile(name, savebuffer, length)) 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 else
players[consoleplayer].message = s_GGSAVED; // Ty 03/27/98 - externalized players[consoleplayer].message = s_GGSAVED; // Ty 03/27/98 - externalized

View File

@ -2399,7 +2399,7 @@ void M_ScreenShot (void)
// players[consoleplayer].message = "screen shot" // players[consoleplayer].message = "screen shot"
// killough 10/98: print error message and change sound effect if error // 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 : "Could not take screenshot"), sfx_oof :
gamemode==commercial ? sfx_radio : sfx_tink); gamemode==commercial ? sfx_radio : sfx_tink);