mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-20 20:36:53 +00:00
IRC_SQUIT(): Fix use-after-free when unregistering the sending client
This commit is contained in:
parent
02cf31c0e2
commit
d697de3186
@ -367,7 +367,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
|
|||||||
{
|
{
|
||||||
char msg[COMMAND_LEN], logmsg[COMMAND_LEN];
|
char msg[COMMAND_LEN], logmsg[COMMAND_LEN];
|
||||||
CLIENT *from, *target;
|
CLIENT *from, *target;
|
||||||
CONN_ID con;
|
CONN_ID con, client_con;
|
||||||
int loglevel;
|
int loglevel;
|
||||||
|
|
||||||
assert(Client != NULL);
|
assert(Client != NULL);
|
||||||
@ -407,6 +407,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
|
|||||||
return CONNECTED;
|
return CONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client_con = Client_Conn(Client);
|
||||||
con = Client_Conn(target);
|
con = Client_Conn(target);
|
||||||
|
|
||||||
if (Req->argv[1][0])
|
if (Req->argv[1][0])
|
||||||
@ -428,7 +429,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
|
|||||||
Req->argv[0], Client_ID(from),
|
Req->argv[0], Client_ID(from),
|
||||||
Req->argv[1][0] ? Req->argv[1] : "-");
|
Req->argv[1][0] ? Req->argv[1] : "-");
|
||||||
Conn_Close(con, NULL, msg, true);
|
Conn_Close(con, NULL, msg, true);
|
||||||
if (con == Client_Conn(Client))
|
if (con == client_con)
|
||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
} else {
|
} else {
|
||||||
/* This server is not directly connected, so the SQUIT must
|
/* This server is not directly connected, so the SQUIT must
|
||||||
|
Loading…
Reference in New Issue
Block a user