mirror of
https://github.com/znc/znc.git
synced 2026-07-30 21:43:49 +02:00
Don't store "this" in static variable
Fix #1960 This could also cause use-after-free if the first connected socket disconnects
This commit is contained in:
@@ -1191,5 +1191,24 @@ TEST_F(ZNCTest, JoinWhileRegistration) {
|
||||
ircd.ReadUntil("JOIN #foo");
|
||||
}
|
||||
|
||||
TEST_F(ZNCTest, Issue1960) {
|
||||
auto znc = Run();
|
||||
auto ircd1 = ConnectIRCd();
|
||||
auto client = LoginClient();
|
||||
ircd1.Write("CAP user ACK :message-tags");
|
||||
ircd1.Write(":server 001 nick :Hello");
|
||||
ircd1.Write(":server 005 nick blahblah");
|
||||
client.ReadUntil("blahblah");
|
||||
client.Write("znc addnetwork second");
|
||||
client.Write("znc jumpnetwork second");
|
||||
client.Write("znc addserver unix:" + m_dir.path().toUtf8() + "/inttest.ircd");
|
||||
auto ircd2 = ConnectIRCd();
|
||||
ircd2.Write("CAP user ACK :message-tags");
|
||||
ircd2.Write(":server 001 nick :Hello");
|
||||
client.ReadUntil("Connected");
|
||||
client.Write("@foo TAGMSG #bar");
|
||||
ircd2.ReadUntil("@foo TAGMSG #bar");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace znc_inttest
|
||||
|
||||
Reference in New Issue
Block a user