Fixed 2 remotely exploitable buffer overflow bugs.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2229 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Mark Olsen 2006-04-21 16:25:25 +00:00
parent 0cc2ba719c
commit 618aa941b7

View file

@ -1368,11 +1368,11 @@ void S_Play(void)
{
if (!Q_strrchr(Cmd_Argv(i), '.'))
{
Q_strcpy(name, Cmd_Argv(i));
Q_strncpy(name, Cmd_Argv(i), sizeof(name)-4);
Q_strcat(name, ".wav");
}
else
Q_strcpy(name, Cmd_Argv(i));
Q_strncpy(name, Cmd_Argv(i), sizeof(name));
sfx = S_PrecacheSound(name);
S_StartSound(cl.playernum[0]+1, -1, sfx, vec3_origin, 1.0, 0.0);
// hash++;
@ -1393,11 +1393,11 @@ void S_PlayVol(void)
{
if (!Q_strrchr(Cmd_Argv(i), '.'))
{
Q_strcpy(name, Cmd_Argv(i));
Q_strncpy(name, Cmd_Argv(i), sizeof(name)-4);
Q_strcat(name, ".wav");
}
else
Q_strcpy(name, Cmd_Argv(i));
Q_strncpy(name, Cmd_Argv(i), sizeof(name));
sfx = S_PrecacheSound(name);
vol = Q_atof(Cmd_Argv(i+1));
S_StartSound(cl.playernum[0]+1, -1, sfx, vec3_origin, vol, 0.0);