mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Merge branch 'invalid-node-hotfix_master' into 'master'
Invalid node hotfix master Quick hotfix to prevent `Net_CloseConnection` from crashing if the node's number is invalid. See merge request !179
This commit is contained in:
commit
435ea7dc9d
1 changed files with 6 additions and 0 deletions
|
@ -716,6 +716,12 @@ void Net_CloseConnection(INT32 node)
|
|||
if (!node)
|
||||
return;
|
||||
|
||||
if (node < 0 || node >= MAXNETNODES) // prevent invalid nodes from crashing the game
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Net_CloseConnection: invalid node %d detected!\n"), node);
|
||||
return;
|
||||
}
|
||||
|
||||
nodes[node].flags |= NF_CLOSE;
|
||||
|
||||
// try to Send ack back (two army problem)
|
||||
|
|
Loading…
Reference in a new issue