diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-12 22:30:27 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-12 22:30:27 +0000 |
commit | 69e28c67dddd8b74ee4c321667d286111e09e5da (patch) | |
tree | b5de7bc4ab8abfc93b1adc0721f62ba5d54e5760 /src/modules/m_dnsbl.cpp | |
parent | 39cf323606a311b3b7f59a9c9f39a21d42520c24 (diff) |
Remove possible references to deleted User objects due to DNS lookups
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12445 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_dnsbl.cpp')
-rw-r--r-- | src/modules/m_dnsbl.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 8fa627ab8..818450b79 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -45,17 +45,15 @@ class DNSBLConfEntry */ class DNSBLResolver : public Resolver { - int theirfd; - LocalUser* them; + std::string theiruid; DNSBLConfEntry *ConfEntry; public: - DNSBLResolver(Module *me, const std::string &hostname, LocalUser* u, int userfd, DNSBLConfEntry *conf, bool &cached) + DNSBLResolver(Module *me, const std::string &hostname, LocalUser* u, DNSBLConfEntry *conf, bool &cached) : Resolver(hostname, DNS_QUERY_A, cached, me) { - theirfd = userfd; - them = u; + theiruid = u->uuid; ConfEntry = conf; } @@ -63,7 +61,8 @@ class DNSBLResolver : public Resolver virtual void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached) { /* Check the user still exists */ - if ((them) && (&them->eh == ServerInstance->SE->GetRef(theirfd))) + User* them = ServerInstance->FindUUID(theiruid); + if (them) { // Now we calculate the bitmask: 256*(256*(256*a+b)+c)+d if(result.length()) @@ -352,7 +351,7 @@ class ModuleDNSBL : public Module /* now we'd need to fire off lookups for `hostname'. */ bool cached; - DNSBLResolver *r = new DNSBLResolver(this, hostname, user, user->GetFd(), *i, cached); + DNSBLResolver *r = new DNSBLResolver(this, hostname, user, *i, cached); ServerInstance->AddResolver(r, cached); } |