diff --git a/code/client/cl_main.c b/code/client/cl_main.c index 31dd9ab7..e9a406e6 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -1069,7 +1069,8 @@ demo */ void CL_PlayDemo_f( void ) { char name[MAX_OSPATH]; - char *arg, *ext_test; + char arg[MAX_OSPATH]; + char *ext_test; int protocol, i; char retry[MAX_OSPATH]; @@ -1083,7 +1084,7 @@ void CL_PlayDemo_f( void ) { Cvar_Set( "sv_killserver", "2" ); // open the demo file - arg = Cmd_Argv(1); + Q_strncpyz( arg, Cmd_Argv(1), sizeof( arg ) ); CL_Disconnect( qtrue ); @@ -1690,7 +1691,7 @@ CL_Connect_f ================ */ void CL_Connect_f( void ) { - char *server; + char server[MAX_OSPATH]; const char *serverString; int argc = Cmd_Argc(); netadrtype_t family = NA_UNSPEC; @@ -1701,7 +1702,7 @@ void CL_Connect_f( void ) { } if(argc == 2) - server = Cmd_Argv(1); + Q_strncpyz( server, Cmd_Argv(1), sizeof( server ) ); else { if(!strcmp(Cmd_Argv(1), "-4")) @@ -1711,7 +1712,7 @@ void CL_Connect_f( void ) { else Com_Printf( "warning: only -4 or -6 as address type understood.\n"); - server = Cmd_Argv(2); + Q_strncpyz( server, Cmd_Argv(2), sizeof( server ) ); } // save arguments for reconnect