From fce86135c032720ae94e4a028d792bbe70664804 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 11 May 2025 17:12:00 +0200 Subject: [PATCH] fix oob write when map has playerstarts for 32 players playerstarts is MAXPLAYERS big, which is 16 for us --- src/p_mobj.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b3d362e0b..2fe6cff23 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -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; }