diff options
author | B00mX0r <b00mx0r@aureus.pw> | 2017-12-03 14:36:57 -0800 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-12-11 11:02:22 +0000 |
commit | 6f3cf8aaa60bc4ab9e48520db26cd8e46360f6bf (patch) | |
tree | 32352e53f159185c91555cecc0ea0979fa323bb4 /src | |
parent | fb4abb7669cbdcec05c79fe78ae9d256dece2dc8 (diff) |
Ensure that ModeParser doesn't try to process a non-existent mode.
This fixes #1431 and closes #1432.
Diffstat (limited to 'src')
-rw-r--r-- | src/mode.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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)) |