Skip to content

Commit

Permalink
sv_user.c: check if prydon cursor entnum is in range
Browse files Browse the repository at this point in the history
  • Loading branch information
eukara committed Sep 9, 2024
1 parent 2efeab6 commit 01a78ca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions engine/server/sv_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -8051,6 +8051,10 @@ static void SV_ReadPrydonCursor(usercmd_t *cmd)
cmd->cursor_impact[2] = MSG_ReadFloat();
cmd->cursor_entitynumber = MSGSV_ReadEntity(host_client);

/* client is sending junk or trying to crash us -eukara */
if (cmd->cursor_entitynumber < 0 || cmd->cursor_entitynumber >= sv.world.num_edicts) {
cmd->cursor_entitynumber = 0;
}

if (svprogfuncs)
{
Expand Down

0 comments on commit 01a78ca

Please sign in to comment.