summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-28 21:07:45 +0000
committerrubidium <rubidium@openttd.org>2008-12-28 21:07:45 +0000
commit5fe023cb1beaa8fbfd3a78e68495abbabc4236c8 (patch)
treecaa9a1b5f5ce4b37fab3bb77b97803d5b6e3494e /src/network/core
parent1f5d51562f190af043a35f21a417ddc38dc8aec6 (diff)
downloadopenttd-5fe023cb1beaa8fbfd3a78e68495abbabc4236c8.tar.xz
(svn r14759) -Fix (r14730): tab completion causing out-of-bounds read.
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/tcp.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h
index 06d382f6c..84863ca2f 100644
--- a/src/network/core/tcp.h
+++ b/src/network/core/tcp.h
@@ -127,7 +127,7 @@ static inline bool IsValidNetworkClientSocketIndex(ClientIndex index)
return (uint)index < GetNetworkClientSocketPoolSize() && GetNetworkClientSocket(index)->IsValid();
}
-#define FOR_ALL_CLIENT_SOCKETS_FROM(d, start) for (d = (start < GetNetworkClientSocketPoolSize() ? GetNetworkClientSocket(start) : NULL); d != NULL; d = (d->index + 1U < GetNetworkClientSocketPoolSize()) ? GetNetworkClientSocket(d->index + 1U) : NULL) if (d->IsValid())
+#define FOR_ALL_CLIENT_SOCKETS_FROM(d, start) for (d = GetNetworkClientSocket(start); d != NULL; d = (d->index + 1U < GetNetworkClientSocketPoolSize()) ? GetNetworkClientSocket(d->index + 1U) : NULL) if (d->IsValid())
#define FOR_ALL_CLIENT_SOCKETS(d) FOR_ALL_CLIENT_SOCKETS_FROM(d, 0)
typedef NetworkClientSocket NetworkTCPSocketHandler;