diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-21 17:08:36 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-21 17:08:36 +0000 |
commit | 4b2784862e7879b22f694801a25c4b2bedb457f9 (patch) | |
tree | 99a58665e35a08c0511ecbb64b11fcd8c204761b /src | |
parent | fa6e82fe50ebb3140f6e31cc128cac9e442bccbd (diff) |
Fix exception on m_cloaking GetVersion if run without a hash provider
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12506 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_cloaking.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 0405e31dd..56a2f5d43 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -336,21 +336,23 @@ class ModuleCloaking : public Module Version GetVersion() { - std::string testcloak; - switch (mode) + std::string testcloak = "broken"; + if (Hash) { - case MODE_COMPAT_HOST: - testcloak = prefix + "-" + Hash->sumIV(compatkey, xtab[0], "*").substr(0,10); - break; - case MODE_COMPAT_IPONLY: - testcloak = Hash->sumIV(compatkey, xtab[0], "*").substr(0,10); - break; - case MODE_HALF_CLOAK: - testcloak = prefix + SegmentCloak("*", 3); - break; - case MODE_OPAQUE: - default: - testcloak = prefix + SegmentCloak("*", 4); + switch (mode) + { + case MODE_COMPAT_HOST: + testcloak = prefix + "-" + Hash->sumIV(compatkey, xtab[0], "*").substr(0,10); + break; + case MODE_COMPAT_IPONLY: + testcloak = Hash->sumIV(compatkey, xtab[0], "*").substr(0,10); + break; + case MODE_HALF_CLOAK: + testcloak = prefix + SegmentCloak("*", 3); + break; + case MODE_OPAQUE: + testcloak = prefix + SegmentCloak("*", 4); + } } return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR, testcloak); } |