aboutsummaryrefslogtreecommitdiffstats
path: root/code/game
diff options
context:
space:
mode:
authorludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-08-19 12:11:39 +0000
committerludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-08-19 12:11:39 +0000
commit37c20d0ddfb0b25296cabe9755231ceb2b43dedd (patch)
tree9f7b98b4a1e13863180401c351ec0c39b1ac64e1 /code/game
parentea74788828dfaf5232ff85d324b985c089b6da4c (diff)
downloadioquake3-aero-37c20d0ddfb0b25296cabe9755231ceb2b43dedd.tar.gz
ioquake3-aero-37c20d0ddfb0b25296cabe9755231ceb2b43dedd.zip
fix null termination out of array bounds
git-svn-id: svn://svn.icculus.org/quake3/trunk@1126 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/game')
-rw-r--r--code/game/ai_cmd.c2
-rw-r--r--code/game/ai_team.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/code/game/ai_cmd.c b/code/game/ai_cmd.c
index 2924284..db95485 100644
--- a/code/game/ai_cmd.c
+++ b/code/game/ai_cmd.c
@@ -1308,7 +1308,7 @@ void BotMatch_StartTeamLeaderShip(bot_state_t *bs, bot_match_t *match) {
//get the team mate that will be the team leader
trap_BotMatchVariable(match, NETNAME, teammate, sizeof(teammate));
strncpy(bs->teamleader, teammate, sizeof(bs->teamleader));
- bs->teamleader[sizeof(bs->teamleader)] = '\0';
+ bs->teamleader[sizeof(bs->teamleader)-1] = '\0';
}
//chats for someone else
else {
diff --git a/code/game/ai_team.c b/code/game/ai_team.c
index 35578a1..858c16c 100644
--- a/code/game/ai_team.c
+++ b/code/game/ai_team.c
@@ -1960,7 +1960,7 @@ void BotTeamAI(bot_state_t *bs) {
BotSayVoiceTeamOrder(bs, -1, VOICECHAT_STARTLEADER);
ClientName(bs->client, netname, sizeof(netname));
strncpy(bs->teamleader, netname, sizeof(bs->teamleader));
- bs->teamleader[sizeof(bs->teamleader)] = '\0';
+ bs->teamleader[sizeof(bs->teamleader)-1] = '\0';
bs->becometeamleader_time = 0;
}
return;