summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-21 17:08:36 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-21 17:08:36 +0000
commit4b2784862e7879b22f694801a25c4b2bedb457f9 (patch)
tree99a58665e35a08c0511ecbb64b11fcd8c204761b
parentfa6e82fe50ebb3140f6e31cc128cac9e442bccbd (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
-rw-r--r--src/modules/m_cloaking.cpp30
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);
}