From 604b63f00f3f38ab8be33d8e1e72c086d9148fbd Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 12 Jul 2015 21:06:46 -0500 Subject: [PATCH] Fix cgs.teamVoteString buffer overflow in CG_ConfigStringModified Found by Coverity. --- code/cgame/cg_servercmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/cgame/cg_servercmds.c b/code/cgame/cg_servercmds.c index 648353b5..e863edca 100644 --- a/code/cgame/cg_servercmds.c +++ b/code/cgame/cg_servercmds.c @@ -326,7 +326,7 @@ static void CG_ConfigStringModified( void ) { cgs.teamVoteNo[num-CS_TEAMVOTE_NO] = atoi( str ); cgs.teamVoteModified[num-CS_TEAMVOTE_NO] = qtrue; } 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 trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER ); #endif