diff options
| author | 2015-05-17 18:00:42 +0200 | |
|---|---|---|
| committer | 2015-05-17 18:00:42 +0200 | |
| commit | b28782c4a3cd52587d61541bcca4e0b217685c54 (patch) | |
| tree | 6e2a88b2907821a2ab3c964e582a35cd54066983 /src/modules/m_jumpserver.cpp | |
| parent | Merge pull request #1048 from SaberUK/master+ipv6-stats (diff) | |
| download | inspircd++-b28782c4a3cd52587d61541bcca4e0b217685c54.tar.gz inspircd++-b28782c4a3cd52587d61541bcca4e0b217685c54.tar.bz2 inspircd++-b28782c4a3cd52587d61541bcca4e0b217685c54.zip | |
Fix incorrect iterator use leading to prematurely exiting loops when quitting users while looping the local user list
Diffstat (limited to 'src/modules/m_jumpserver.cpp')
| -rw-r--r-- | src/modules/m_jumpserver.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/m_jumpserver.cpp b/src/modules/m_jumpserver.cpp index 599144448..e9c07f45f 100644 --- a/src/modules/m_jumpserver.cpp +++ b/src/modules/m_jumpserver.cpp @@ -109,9 +109,11 @@ class CommandJumpserver : public Command { /* Redirect everyone but the oper sending the command */ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers(); - for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i) + for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ) { + // Quitting the user removes it from the list LocalUser* t = *i; + ++i; if (!t->IsOper()) { t->WriteNumeric(RPL_REDIR, "%s %d :Please use this Server/Port instead", parameters[0].c_str(), GetPort(t)); |
