Fixed a potential buffer overflow.

This commit is contained in:
Walter Julius Hennecke 2014-03-29 01:21:28 +01:00
parent cbc513b637
commit 128be4b0b8
3 changed files with 8 additions and 8 deletions

View file

@ -11,7 +11,7 @@
// because games can change separately from the main system version, we need a
// second version that must match between game and cgame
#define RPGX_VERSION "RPG-X V 2.4.0ua"
#define RPGX_VERSION "RPG-X V 2.4.1ua"
#define RPGX_COMPILEDATE __DATE__ " " __TIME__
#define RPGX_COMPILEDBY "Jenkins Buildserver"
#define GAME_VERSION "RPG-X v" RPGX_VERSION

View file

@ -1408,13 +1408,13 @@ static void G_SayTo(gentity_t* ent, gentity_t* other, int32_t mode, int32_t colo
if (mode == SAY_CLASS && !OnSameClass(ent, other) && (G_Client_IsAdmin(other) == qfalse)) {
return;
}
if (mode == SAY_ADMIN && (G_Client_IsAdmin(other) == qfalse)) {
return;
}
// no chatting to players in tournements
if (g_gametype.integer == GT_TOURNAMENT
&& other->client->sess.sessionTeam == TEAM_FREE
&& sess->sessionTeam != TEAM_FREE) {
if (g_gametype.integer == GT_TOURNAMENT && other->client->sess.sessionTeam == TEAM_FREE && sess->sessionTeam != TEAM_FREE) {
return;
}
@ -1437,8 +1437,8 @@ static void G_Say(gentity_t* ent, gentity_t* target, int32_t mode, const char* c
int32_t j = 0;
gentity_t* other = NULL;
int32_t color = 0;
char name[80];
char text[150];
char name[136];
char text[878];
char location[64];
char* className = NULL;
gclient_t* entClient = NULL;
@ -1526,7 +1526,7 @@ static void G_Say(gentity_t* ent, gentity_t* target, int32_t mode, const char* c
break;
case SAY_ADMIN:
if (G_Client_GetLocationMsg(ent, location, sizeof(location)) && tarPers)
Com_sprintf(name, sizeof(name), "[%s%c%c] [%s] (%s): ", entPers->netname, Q_COLOR_ESCAPE, COLOR_WHITE, tarPers->netname, location);
Com_sprintf(name, sizeof(name), "[%s%c%c] [%s] (%s): ", entPers->netname, Q_COLOR_ESCAPE, COLOR_WHITE, tarPers->netname, location); // todo: this is bad
else if (tarPers)
Com_sprintf(name, sizeof(name), "[%s%c%c ^7To %s^7]: ", entPers->netname, Q_COLOR_ESCAPE, COLOR_WHITE, tarPers->netname);
else return;

View file

@ -3,7 +3,7 @@
#ifndef STV_VERSION_H_
#define STV_VERSION_H_
#define Q3_VERSION "RPG-X V 2.4.0ua"
#define Q3_VERSION "RPG-X V 2.4.1ua"
#endif /* STV_VERSION_H_ */