From 2bce37fc7dc10ad719cddd5094845e57c93ff095 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 6 Nov 2017 00:29:51 +0000 Subject: Fix an unhandled exception crash when rehashing modules. Previously we used FOREACH_MOD to call OnRehash which handled any thrown exceptions. When we switched to ReadConfig this stopped being the case. This bug was introduced in c202dea024. --- src/configreader.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/configreader.cpp b/src/configreader.cpp index 2a50a22b3..e242641f1 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -820,7 +820,17 @@ void ConfigReaderThread::Finish() ConfigStatus status(user); const ModuleManager::ModuleMap& mods = ServerInstance->Modules->GetModules(); for (ModuleManager::ModuleMap::const_iterator i = mods.begin(); i != mods.end(); ++i) - i->second->ReadConfig(status); + { + try + { + ServerInstance->Logs->Log("MODULE", LOG_DEBUG, "Rehashing " + i->first); + i->second->ReadConfig(status); + } + catch (CoreException& modex) + { + ServerInstance->Logs->Log("MODULE", LOG_DEFAULT, "Exception caught: " + modex.GetReason()); + } + } // The description of this server may have changed - update it for WHOIS etc. ServerInstance->FakeClient->server->description = Config->ServerDesc; -- cgit v1.2.3