From 403fbdfd6b2f415551357a882ee7addecefc6ca0 Mon Sep 17 00:00:00 2001 From: truelight Date: Sun, 16 Jan 2005 17:19:37 +0000 Subject: [PATCH] (svn r1546) -Fix: possible buffer-overflow in network --- network_server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_server.c b/network_server.c index 0e37fc8ffd..2108ee0840 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 {