Skip to content

Commit

Permalink
A fix for Debian Bug #681812. Doing "callvote kick PLAYERNAME" for a …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
sago007@gmail.com committed Sep 6, 2012
1 parent 7112385 commit f0c49c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/game/g_cmds.c
Expand Up @@ -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
Expand Down

0 comments on commit f0c49c2

Please sign in to comment.