summaryrefslogtreecommitdiff
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
commit85213673734ddaf2bd02f6be74341a5e0eeda47c (patch)
tree22bfdf6db1d1e779439a58f33af363364606a378
parent022b8cea37b1ae1a3a1745c5373d202a7f267a2d (diff)
downloadopenttd-85213673734ddaf2bd02f6be74341a5e0eeda47c.tar.xz
(svn r1546) -Fix: possible buffer-overflow in network
-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 {