summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2006-01-13 02:19:18 +0000
committerSimon Howard2006-01-13 02:19:18 +0000
commitc1e37f1955a0c546a795484acc92510e4c4dc6b2 (patch)
tree9f963cf597c10c403c7f8e9c072800b1d6cb4fd6
parent01e9eff0e42b4255fd230fe1f9e5de9c9ed16e8f (diff)
downloadchocolate-doom-c1e37f1955a0c546a795484acc92510e4c4dc6b2.tar.gz
chocolate-doom-c1e37f1955a0c546a795484acc92510e4c4dc6b2.tar.bz2
chocolate-doom-c1e37f1955a0c546a795484acc92510e4c4dc6b2.zip
Only accept sane player values when starting a new game.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 286
-rw-r--r--src/net_client.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/net_client.c b/src/net_client.c
index c071d37a..e08a9f9f 100644
--- a/src/net_client.c
+++ b/src/net_client.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_client.c 285 2006-01-12 02:18:59Z fraggle $
+// $Id: net_client.c 286 2006-01-13 02:19:18Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -21,6 +21,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.19 2006/01/13 02:19:18 fraggle
+// Only accept sane player values when starting a new game.
+//
// Revision 1.18 2006/01/12 02:18:59 fraggle
// Only start new games when in the waiting-for-start state.
//
@@ -259,6 +262,12 @@ static void NET_CL_ParseGameStart(net_packet_t *packet)
return;
}
+ if (num_players >= MAXPLAYERS || player_number >= num_players)
+ {
+ // insane values
+ return;
+ }
+
// Start the game
consoleplayer = player_number;