diff options
author | Peter Powell <petpow@saberuk.com> | 2017-11-27 14:13:42 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-11-28 13:48:50 +0000 |
commit | 25c1319e0d16f4cea707a3b7968b70530a5a333f (patch) | |
tree | 288a5ea6c92667adb1be88e43bc7fa58057117df /src/channels.cpp | |
parent | bf9a8e8a50c338bfa660382b5fd66064167a1d51 (diff) |
Add length checking to GetExtBanStatus and m_banexception.
As far as I can tell this is not a problem as all ban masks are
canonicalised but its better to be safe than sorry.
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 9f1eafd0c..df2212a21 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -476,7 +476,7 @@ ModResult Channel::GetExtBanStatus(User *user, char type) return rv; for (BanList::iterator i = this->bans.begin(); i != this->bans.end(); i++) { - if (i->data[0] == type && i->data[1] == ':') + if (i->data.length() > 2 && i->data[0] == type && i->data[1] == ':') { std::string val = i->data.substr(2); if (CheckBan(user, val)) |