mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-25 13:32:01 +00:00
o rcon now prints (hidden) instead of the rcon password
* taniwha drops a 900lb security manual on zoid's head <taniwha> nah, make that kg :) o fix a potential buffer overflow
This commit is contained in:
parent
ea766e6203
commit
f0c35d7f9d
1 changed files with 10 additions and 9 deletions
|
@ -878,6 +878,7 @@ Redirect all printfs
|
|||
void SVC_RemoteCommand (void)
|
||||
{
|
||||
int i;
|
||||
int len = 0;
|
||||
char remaining[1024];
|
||||
|
||||
if (CheckForFlood(FLOOD_RCON)) return;
|
||||
|
@ -892,19 +893,19 @@ void SVC_RemoteCommand (void)
|
|||
|
||||
} else {
|
||||
|
||||
Con_Printf ("Rcon from %s:\n%s\n"
|
||||
, NET_AdrToString (net_from), net_message.data+4);
|
||||
|
||||
SV_BeginRedirect (RD_PACKET);
|
||||
|
||||
remaining[0] = 0;
|
||||
|
||||
for (i=2 ; i<Cmd_Argc() ; i++)
|
||||
{
|
||||
strcat (remaining, Cmd_Argv(i) );
|
||||
strcat (remaining, " ");
|
||||
for (i=2 ; i<Cmd_Argc() ; i++) {
|
||||
strncat (remaining, Cmd_Argv(i), sizeof (remaining) - len - 1);
|
||||
strncat (remaining, " ", sizeof (remaining) - len - 2);
|
||||
len += strlen (Cmd_Argv (i)) + 1; // +1 for " "
|
||||
}
|
||||
|
||||
Con_Printf ("Rcon from %s:\nrcon (hidden) %s\n"
|
||||
, NET_AdrToString (net_from), remaining);
|
||||
|
||||
SV_BeginRedirect (RD_PACKET);
|
||||
|
||||
Cmd_ExecuteString (remaining);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue