mirror of
https://github.com/osmarks/ngircd.git
synced 2024-12-12 01:40:27 +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:
parent
3675c7567c
commit
1db3447c90
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user