summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-09-26 23:49:15 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-09-26 23:49:15 +0000
commit2be86e1958ca8de8aaad54f75a8d6afec59d49af (patch)
tree72bfb8ac3a4f013bf4e82cc8cdbdac6369b7946f /src/users.cpp
parent3283fa835e592b72a8638102af99b8d572cf4c8c (diff)
Fixed bug #404; this was caused by recieving multiple OPERTYPEs from a remote server, which eventually resulted in bad pointers inside the all_opers list
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8084 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/users.cpp b/src/users.cpp
index b357fd149..4f5c567d2 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -830,16 +830,9 @@ void userrec::UnOper()
// unset their oper type (what IS_OPER checks), and remove +o
*this->oper = 0;
this->modes[UM_OPERATOR] = 0;
-
- // remove them from the opers list.
- for (std::vector<userrec*>::iterator a = ServerInstance->all_opers.begin(); a < ServerInstance->all_opers.end(); a++)
- {
- if (*a == this)
- {
- ServerInstance->all_opers.erase(a);
- return;
- }
- }
+
+ // remove the user from the oper list. Will remove multiple entries as a safeguard against bug #404
+ ServerInstance->all_opers.remove(this);
}
}