]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Ensure that ModeParser doesn't try to process a non-existent mode.
authorB00mX0r <b00mx0r@aureus.pw>
Sun, 3 Dec 2017 22:36:57 +0000 (14:36 -0800)
committerPeter Powell <petpow@saberuk.com>
Mon, 11 Dec 2017 11:02:22 +0000 (11:02 +0000)
This fixes #1431 and closes #1432.

src/mode.cpp

index e2129b55a46ce03a9466d169b2bed3886c5d082b..c07c342a362d71211a0d7f0e351c27654e8c0244 100644 (file)
@@ -449,6 +449,12 @@ unsigned int ModeParser::ProcessSingle(User* user, Channel* targetchannel, User*
                Modes::Change& item = *i;
                ModeHandler* mh = item.mh;
 
+               // If a mode change has been given for a mode that does not exist then reject
+               // it. This can happen when core_reloadmodule attempts to restore a mode that
+               // no longer exists.
+               if (!mh)
+                       continue;
+
                // If the mode is supposed to have a parameter then we first take a look at item.param
                // and, if we were asked to, also handle mode merges now
                if (mh->NeedsParam(item.adding))