mirror of
https://github.com/ioquake/jedi-academy.git
synced 2024-11-24 21:21:33 +00:00
Fix to multiple buffer overflow bugs in CL_Rcon_f
from Tim Angus in ioquake3 svn 95 git 33a48a0336865a9d21983e4836920cd9f3401101 Fix to multiple buffer overflow bugs in CL_Rcon_f from http://www.quakesrc.org/forums/viewtopic.php?t=5374
This commit is contained in:
parent
8fc8601e0b
commit
fefad8e48c
1 changed files with 7 additions and 6 deletions
|
@ -1210,6 +1210,7 @@ void CL_Connect_f( void ) {
|
|||
Cvar_Set( "cl_currentServerAddress", server );
|
||||
}
|
||||
|
||||
#define MAX_RCON_MESSAGE 1024
|
||||
|
||||
/*
|
||||
=====================
|
||||
|
@ -1220,7 +1221,7 @@ CL_Rcon_f
|
|||
=====================
|
||||
*/
|
||||
void CL_Rcon_f( void ) {
|
||||
char message[1024];
|
||||
char message[MAX_RCON_MESSAGE];
|
||||
int i;
|
||||
netadr_t to;
|
||||
|
||||
|
@ -1236,14 +1237,14 @@ void CL_Rcon_f( void ) {
|
|||
message[3] = -1;
|
||||
message[4] = 0;
|
||||
|
||||
strcat (message, "rcon ");
|
||||
Q_strcat (message, MAX_RCON_MESSAGE, "rcon ");
|
||||
|
||||
strcat (message, rcon_client_password->string);
|
||||
strcat (message, " ");
|
||||
Q_strcat (message, MAX_RCON_MESSAGE, rcon_client_password->string);
|
||||
Q_strcat (message, MAX_RCON_MESSAGE, " ");
|
||||
|
||||
for (i=1 ; i<Cmd_Argc() ; i++) {
|
||||
strcat (message, Cmd_Argv(i));
|
||||
strcat (message, " ");
|
||||
Q_strcat (message, MAX_RCON_MESSAGE, Cmd_Argv(i));
|
||||
Q_strcat (message, MAX_RCON_MESSAGE, " ");
|
||||
}
|
||||
|
||||
if ( cls.state >= CA_CONNECTED ) {
|
||||
|
|
Loading…
Reference in a new issue