mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-23 12:42:36 +00:00
fix overflow in CG_ParseTeamInfo, based on patch for Tremulous, thanks to Roman Tetelman
This commit is contained in:
parent
c9f4085bc4
commit
2ba76d233e
1 changed files with 9 additions and 1 deletions
|
@ -387,9 +387,17 @@ static void CG_ParseTeamInfo(void)
|
|||
|
||||
numSortedTeamPlayers = atoi(CG_Argv(1));
|
||||
|
||||
if (numSortedTeamPlayers < 0 || numSortedTeamPlayers > TEAM_MAXOVERLAY) {
|
||||
CG_Error("CG_ParseTeamInfo: numSortedTeamPlayers out of range (%d)",
|
||||
numSortedTeamPlayers);
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < numSortedTeamPlayers; i++) {
|
||||
client = atoi(CG_Argv(i * 6 + 2));
|
||||
|
||||
if (client < 0 || client >= MAX_CLIENTS) {
|
||||
CG_Error("CG_ParseTeamInfo: bad client number: %d", client);
|
||||
return;
|
||||
}
|
||||
sortedTeamPlayers[i] = client;
|
||||
|
||||
cgs.clientinfo[client].location = atoi(CG_Argv(i * 6 + 3));
|
||||
|
|
Loading…
Reference in a new issue