X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmode.cpp;h=c07c342a362d71211a0d7f0e351c27654e8c0244;hb=e336c3dfa9be7fd2f571b58f03745e23f4544513;hp=e2129b55a46ce03a9466d169b2bed3886c5d082b;hpb=98372c3cf2c1455e41c388d822876a4d146ae76d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/mode.cpp b/src/mode.cpp index e2129b55a..c07c342a3 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -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))