From 4b2784862e7879b22f694801a25c4b2bedb457f9 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 21 Feb 2010 17:08:36 +0000 Subject: 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 --- src/modules/m_cloaking.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/modules') 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); } -- cgit v1.2.3