Fix buffer overflow in SV_SendPlayerInfo

This commit is contained in:
Gustaf Alhäll 2023-12-14 17:15:07 +01:00
parent 2450a0df70
commit fe87760c8c
No known key found for this signature in database
GPG key ID: 6C1F67D690CDEDFD

View file

@ -164,7 +164,7 @@ static void SV_SendPlayerInfo(INT32 node)
for (UINT8 i = 0; i < MAXPLAYERS; i++) for (UINT8 i = 0; i < MAXPLAYERS; i++)
{ {
if (!netnodes[playernode[i]].ingame) if (playernode[i] == UINT8_MAX || !netnodes[playernode[i]].ingame)
{ {
netbuffer->u.playerinfo[i].num = 255; // This slot is empty. netbuffer->u.playerinfo[i].num = 255; // This slot is empty.
continue; continue;