Changeset - r5569:969448560399
[Not reviewed]
master
0 1 0
Darkvater - 18 years ago 2007-01-08 19:18:53
darkvater@openttd.org
(svn r7984) -Fix: out-of-bounds read access on _clients array (Quark)
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/network/network.c
Show inline comments
 
@@ -72,25 +72,25 @@ NetworkClientInfo *NetworkFindClientInfo
 
	for (ci = _network_client_info; ci != endof(_network_client_info); ci++) {
 
		if (ci->client_ip == ip_number) return ci;
 
	}
 

	
 
	return NULL;
 
}
 

	
 
// Function that looks up the CS for a given client-index
 
NetworkClientState *NetworkFindClientStateFromIndex(uint16 client_index)
 
{
 
	NetworkClientState *cs;
 

	
 
	for (cs = _clients; cs != &_clients[MAX_CLIENT_INFO]; cs++) {
 
	for (cs = _clients; cs != endof(_clients); cs++) {
 
		if (cs->index == client_index) return cs;
 
	}
 

	
 
	return NULL;
 
}
 

	
 
// NetworkGetClientName is a server-safe function to get the name of the client
 
//  if the user did not send it yet, Client #<no> is used.
 
void NetworkGetClientName(char *client_name, size_t size, const NetworkClientState *cs)
 
{
 
	const NetworkClientInfo *ci = DEREF_CLIENT_INFO(cs);
 

	
0 comments (0 inline, 0 general)