Fix cgs.teamVoteString buffer overflow in CG_ConfigStringModified

Found by Coverity.
This commit is contained in:
Zack Middleton 2015-07-12 21:06:46 -05:00
parent a5fbc1bfc4
commit 604b63f00f
1 changed files with 1 additions and 1 deletions

View File

@ -326,7 +326,7 @@ static void CG_ConfigStringModified( void ) {
cgs.teamVoteNo[num-CS_TEAMVOTE_NO] = atoi( str ); cgs.teamVoteNo[num-CS_TEAMVOTE_NO] = atoi( str );
cgs.teamVoteModified[num-CS_TEAMVOTE_NO] = qtrue; cgs.teamVoteModified[num-CS_TEAMVOTE_NO] = qtrue;
} else if ( num >= CS_TEAMVOTE_STRING && num <= CS_TEAMVOTE_STRING + 1) { } else if ( num >= CS_TEAMVOTE_STRING && num <= CS_TEAMVOTE_STRING + 1) {
Q_strncpyz( cgs.teamVoteString[num-CS_TEAMVOTE_STRING], str, sizeof( cgs.teamVoteString ) ); Q_strncpyz( cgs.teamVoteString[num-CS_TEAMVOTE_STRING], str, sizeof( cgs.teamVoteString[0] ) );
#ifdef MISSIONPACK #ifdef MISSIONPACK
trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER ); trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER );
#endif #endif