mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	Fix a possible race condition in Client_Introduce()
Conf_GetServer() can return NULL when the server introducing the client had a write error for example, and is being disconnected. So make sure that we have a valid server before calling Conf_NickIsService()!
This commit is contained in:
		| @@ -1315,12 +1315,14 @@ Client_Reject(CLIENT *Client, const char *Reason, bool InformClient) | ||||
| GLOBAL void | ||||
| Client_Introduce(CLIENT *From, CLIENT *Client, int Type) | ||||
| { | ||||
| 	int server; | ||||
|  | ||||
| 	/* Set client type (user or service) */ | ||||
| 	Client_SetType(Client, Type); | ||||
|  | ||||
| 	if (From) { | ||||
| 		if (Conf_NickIsService(Conf_GetServer(Client_Conn(From)), | ||||
| 				   Client_ID(Client))) | ||||
| 		server = Conf_GetServer(Client_Conn(From)); | ||||
| 		if (server > NONE && Conf_NickIsService(server, Client_ID(Client))) | ||||
| 			Client_SetType(Client, CLIENT_SERVICE); | ||||
| 		LogDebug("%s \"%s\" (+%s) registered (via %s, on %s, %d hop%s).", | ||||
| 			 Client_TypeText(Client), Client_Mask(Client), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Alexander Barton
					Alexander Barton