diff options
author | Adam <Adam@anope.org> | 2016-10-07 19:04:40 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-10-07 19:04:40 -0400 |
commit | 9e01480253fa40b822e0488be24a2c08bce500e2 (patch) | |
tree | c452fd4dfbedf3ed8fd97f34d9ae6e01b2e4564b /modules/protocol/charybdis.cpp | |
parent | 454be59a5d0cb33585f58e73f15a758cf5f67327 (diff) |
Add/fix various checks on source user existing in the protocol modules
Diffstat (limited to 'modules/protocol/charybdis.cpp')
-rw-r--r-- | modules/protocol/charybdis.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/modules/protocol/charybdis.cpp b/modules/protocol/charybdis.cpp index aabb77718..b65c76f37 100644 --- a/modules/protocol/charybdis.cpp +++ b/modules/protocol/charybdis.cpp @@ -215,19 +215,25 @@ class CharybdisProto : public IRCDProto void charybdis::Encap::Run(MessageSource &source, const std::vector<Anope::string> ¶ms) { - User *u = source.GetUser(); - // In a burst, states that the source user is logged in as the account. if (params[1] == "LOGIN" || params[1] == "SU") { + User *u = source.GetUser(); NickServ::Account *nc = NickServ::FindAccount(params[2]); - if (!nc) + + if (!u || !nc) return; + u->Login(nc); } // Received: :42XAAAAAE ENCAP * CERTFP :3f122a9cc7811dbad3566bf2cec3009007c0868f - if (params[1] == "CERTFP") + else if (params[1] == "CERTFP") { + User *u = source.GetUser(); + + if (!u) + return; + u->fingerprint = params[2]; EventManager::Get()->Dispatch(&Event::Fingerprint::OnFingerprint, u); } @@ -242,7 +248,7 @@ void charybdis::Encap::Run(MessageSource &source, const std::vector<Anope::strin * * Charybdis only accepts messages from SASL agents; these must have umode +S */ - if (params[1] == "SASL" && sasl && params.size() >= 6) + else if (params[1] == "SASL" && sasl && params.size() >= 6) { SASL::Message m; m.source = params[2]; |