mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-02 01:21:17 +00:00
remove a whole swath of potential buffer overflows by removing the buffer.
Also audit a few of the "FIXME: overflow" tags
This commit is contained in:
parent
59c26b5ce0
commit
ada828bdc9
12 changed files with 246 additions and 310 deletions
|
@ -663,45 +663,16 @@ CL_AddQFInfoKeys (void)
|
|||
static void
|
||||
CL_FullInfo_f (void)
|
||||
{
|
||||
char key[512], value[512]; //FIXME: overflow
|
||||
char *o;
|
||||
const char *s;
|
||||
info_t *info;
|
||||
|
||||
if (Cmd_Argc () != 2) {
|
||||
Con_Printf ("fullinfo <complete info string>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
s = Cmd_Argv (1);
|
||||
if (*s == '\\')
|
||||
s++;
|
||||
while (*s) {
|
||||
o = key;
|
||||
while (*s && *s != '\\')
|
||||
*o++ = *s++;
|
||||
*o = 0;
|
||||
|
||||
if (!*s) {
|
||||
Con_Printf ("MISSING VALUE\n");
|
||||
return;
|
||||
}
|
||||
|
||||
o = value;
|
||||
s++;
|
||||
while (*s && *s != '\\')
|
||||
*o++ = *s++;
|
||||
*o = 0;
|
||||
|
||||
if (*s)
|
||||
s++;
|
||||
|
||||
if (strcaseequal (key, pmodel_name) || strcaseequal (key, emodel_name))
|
||||
continue;
|
||||
|
||||
Info_SetValueForKey (cls.userinfo, key, value,
|
||||
(!strequal (key, "name")) |
|
||||
(strequal (key, "team") << 1));
|
||||
}
|
||||
info = Info_ParseString (Cmd_Argv (1), MAX_INFO_STRING, 0);
|
||||
Info_AddKeys (cls.userinfo, info);
|
||||
Info_Destroy (info);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue