engine: client: fix off-by-one

This commit is contained in:
Alibek Omarov
2026-05-17 11:48:20 +05:00
parent 4c667d9d8c
commit 92bad81d9a

View File

@@ -891,7 +891,7 @@ static void CL_ParseServerData( sizebuf_t *msg, connprotocol_t proto )
}
}
if( cl.playernum < 0 || cl.playernum >= MAX_CLIENTS || cl.maxclients < 0 || cl.maxclients >= MAX_CLIENTS )
if( cl.playernum < 0 || cl.playernum >= MAX_CLIENTS || cl.maxclients <= 0 || cl.maxclients > MAX_CLIENTS )
{
Con_Printf( S_ERROR "%s: invalid playernum or maxclients (%d and %d must be less than %d)\n", __func__,
cl.playernum, cl.maxclients, MAX_CLIENTS );