Host_Loadgame_f: block relative paths, like Host_Savegame_f does

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1396 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
ewasylishen 2017-04-09 20:42:22 +00:00
parent f01ba4b8d8
commit 87a7f01f75

View file

@ -1126,6 +1126,12 @@ void Host_Loadgame_f (void)
return;
}
if (strstr(Cmd_Argv(1), ".."))
{
Con_Printf ("Relative pathnames are not allowed.\n");
return;
}
cls.demonum = -1; // stop demo loop in case this fails
q_snprintf (name, sizeof(name), "%s/%s", com_gamedir, Cmd_Argv(1));