From f0c49c28c448288572d960840aa541a9017e6d01 Mon Sep 17 00:00:00 2001 From: "sago007@gmail.com" Date: Thu, 6 Sep 2012 20:34:53 +0000 Subject: [PATCH] A fix for Debian Bug #681812. Doing "callvote kick PLAYERNAME" for a playername that did not exist resultet in undefined behavior. Depending on architecture this resultet in a crash or something else. git-svn-id: http://oax.googlecode.com/svn/trunk@304 48ef5666-4144-11de-b6cc-f32266f7ba4a --- code/game/g_cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index 4da9deb2..b92ff343 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -1812,7 +1812,7 @@ void Cmd_CallVote_f( gentity_t *ent ) { Com_sprintf( level.voteDisplayString, sizeof( level.voteDisplayString ), "Shuffle teams?" ); } else if ( !Q_stricmp( arg1, "kick" ) ) { i = 0; - while(Q_stricmp(arg2,(g_entities+i)->client->pers.netname)) { + while( !(g_entities+i) || !((g_entities+i)->client) || Q_stricmp(arg2,(g_entities+i)->client->pers.netname)) { //Not client i, try next i++; if(i>=MAX_CLIENTS){ //Only numbers <128 is clients