]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix for GCC 6 rightfully optimizing out the NULL check of 'this' in ConfigTag::readSt...
authorAttila Molnar <attilamolnar@hush.com>
Thu, 9 Jun 2016 13:12:35 +0000 (15:12 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Thu, 9 Jun 2016 13:12:35 +0000 (15:12 +0200)
Checking is only necessary in ModuleSSLInfo::OnPostConnect() as oper types are not encountered in the other cases but check anyway to be sure

src/commands/cmd_oper.cpp
src/modules/m_sslinfo.cpp

index 1a5e7e1783a4331911d89196b3353722b151ca53..95f6b98df3f45bc7a04a2b3073c1d7a082db4b11 100644 (file)
@@ -69,7 +69,7 @@ CmdResult CommandOper::HandleLocal(const std::vector<std::string>& parameters, L
        snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(),user->GetIPString());
 
        OperIndex::iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]);
-       if (i != ServerInstance->Config->oper_blocks.end())
+       if ((i != ServerInstance->Config->oper_blocks.end()) && (i->second->oper_block))
        {
                OperInfo* ifo = i->second;
                ConfigTag* tag = ifo->oper_block;
index 2bfe0e1c4e0ca285727789b722d48a4056790e6e..083ac0f0448486a212bfc53ad61adfc57a3389ed 100644 (file)
@@ -180,6 +180,9 @@ class ModuleSSLInfo : public Module
                        if (i != ServerInstance->Config->oper_blocks.end())
                        {
                                OperInfo* ifo = i->second;
+                               if (!ifo->oper_block)
+                                       return MOD_RES_PASSTHRU;
+
                                ssl_cert* cert = cmd.CertExt.get(user);
 
                                if (ifo->oper_block->getBool("sslonly") && !cert)
@@ -220,6 +223,9 @@ class ModuleSSLInfo : public Module
                for(OperIndex::iterator i = ServerInstance->Config->oper_blocks.begin(); i != ServerInstance->Config->oper_blocks.end(); i++)
                {
                        OperInfo* ifo = i->second;
+                       if (!ifo->oper_block)
+                               continue;
+
                        std::string fp = ifo->oper_block->getString("fingerprint");
                        if (fp == cert->fingerprint && ifo->oper_block->getBool("autologin"))
                                user->Oper(ifo);