fix a few potential buffer overwrite in Game VM
This commit is contained in:
1 parent
76ec9fb6bd
commit
c904f6d4aa
2 files changed
+8
-8
No files matched your search
+4
-4
@@ -817,19 +817,19 @@ void Svcmd_BotList_f( void ) {
|
||||
|
||||
trap_Print("^1name model aifile funname\n");
|
||||
for (i = 0; i < g_numBots; i++) {
|
||||
strcpy(name, Info_ValueForKey( g_botInfos[i], "name" ));
|
||||
Q_strncpyz(name, Info_ValueForKey( g_botInfos[i], "name" ), sizeof( name ));
|
||||
if ( !*name ) {
|
||||
strcpy(name, "UnnamedPlayer");
|
||||
}
|
||||
strcpy(funname, Info_ValueForKey( g_botInfos[i], "funname" ));
|
||||
Q_strncpyz(funname, Info_ValueForKey( g_botInfos[i], "funname" ), sizeof( funname ));
|
||||
if ( !*funname ) {
|
||||
strcpy(funname, "");
|
||||
}
|
||||
strcpy(model, Info_ValueForKey( g_botInfos[i], "model" ));
|
||||
Q_strncpyz(model, Info_ValueForKey( g_botInfos[i], "model" ), sizeof( model ));
|
||||
if ( !*model ) {
|
||||
strcpy(model, "visor/default");
|
||||
}
|
||||
strcpy(aifile, Info_ValueForKey( g_botInfos[i], "aifile"));
|
||||
Q_strncpyz(aifile, Info_ValueForKey( g_botInfos[i], "aifile"), sizeof( aifile ));
|
||||
if (!*aifile ) {
|
||||
strcpy(aifile, "bots/default_c.c");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user