From 8a785d511c6f2390d40aec33392cea0d3dfcf7cd Mon Sep 17 00:00:00 2001 From: Buginator Date: Wed, 24 Feb 2010 05:08:30 +0000 Subject: [PATCH] If we run out of temp sockets, then we should error out, not "fix" the issue by reusing MAX_TMP_SOCKETS -1. (2.3 r9988) git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9998 4a71c877-e1ca-e34f-864e-861f7616d084 --- lib/netplay/netplay.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/netplay/netplay.c b/lib/netplay/netplay.c index ae07dee4d..9e92b3531 100644 --- a/lib/netplay/netplay.c +++ b/lib/netplay/netplay.c @@ -3220,8 +3220,9 @@ static void NETallowJoining(void) } if (i == MAX_TMP_SOCKETS) { - // prevent out-of-bounds access - i--; + // this should *never* happen, it would mean we are going to reuse a socket already in use. + debug(LOG_ERROR, "all temp sockets are used up!"); + return; } // See if there's an incoming connection