summaryrefslogtreecommitdiff
path: root/network_server.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-01-16 17:19:37 +0000
committertruelight <truelight@openttd.org>2005-01-16 17:19:37 +0000
commit403fbdfd6b2f415551357a882ee7addecefc6ca0 (patch)
tree22bfdf6db1d1e779439a58f33af363364606a378 /network_server.c
parent27057ae4b0757e15b38a5327c1229084ad29a38c (diff)
downloadopenttd-403fbdfd6b2f415551357a882ee7addecefc6ca0.tar.xz
(svn r1546) -Fix: possible buffer-overflow in network
Diffstat (limited to 'network_server.c')
-rw-r--r--network_server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/network_server.c b/network_server.c
index 0e37fc8ff..2108ee084 100644
--- a/network_server.c
+++ b/network_server.c
@@ -644,7 +644,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
if (_network_game_info.use_password)
SEND_COMMAND(PACKET_SERVER_NEED_PASSWORD)(cs, NETWORK_GAME_PASSWORD);
else {
- if (ci->client_playas <= MAX_PLAYERS && _network_player_info[ci->client_playas - 1].password[0] != '\0') {
+ if (ci->client_playas > 0 && ci->client_playas <= MAX_PLAYERS && _network_player_info[ci->client_playas - 1].password[0] != '\0') {
SEND_COMMAND(PACKET_SERVER_NEED_PASSWORD)(cs, NETWORK_COMPANY_PASSWORD);
}
else {