Skip to content
Snippets Groups Projects
Commit 8582406d authored by Monster Iestyn's avatar Monster Iestyn Committed by Alam Ed Arias
Browse files

prevent invalid nodes from crashing Net_CloseConnection, print a warning and return instead

parent 4008cae5
No related branches found
No related tags found
1 merge request!179Invalid node hotfix master
...@@ -716,6 +716,12 @@ void Net_CloseConnection(INT32 node) ...@@ -716,6 +716,12 @@ void Net_CloseConnection(INT32 node)
if (!node) if (!node)
return; return;
if (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; nodes[node].flags |= NF_CLOSE;
// try to Send ack back (two army problem) // try to Send ack back (two army problem)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment