fix oob write when map has playerstarts for 32 players
playerstarts is MAXPLAYERS big, which is 16 for us
This commit is contained in:
1 parent
d9052fff97
commit
fce86135c0
1 file changed
+10
-3
+10
-3
@@ -11168,9 +11168,16 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||
// check for players specially
|
||||
if (mthing->type > 0 && mthing->type <= 32)
|
||||
{
|
||||
// save spots for respawning in network games
|
||||
if (!metalrecording)
|
||||
playerstarts[mthing->type-1] = mthing;
|
||||
if (mthing->type > MAXPLAYERS) // be wary of playerstarts size! playerstarts[MAXPLAYERS]
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "Excess player start detected %d This will crash vanilla clients!\n", mthing->type);
|
||||
}
|
||||
else
|
||||
{
|
||||
// save spots for respawning in network games
|
||||
if (!metalrecording)
|
||||
playerstarts[mthing->type-1] = mthing;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user