mirror of
https://github.com/anope/anope.git
synced 2026-06-27 09:46:38 +02:00
Fixed a crash if an expiring channel had the founder also on the access list
This commit is contained in:
+8
-5
@@ -406,15 +406,11 @@ void expire_chans()
|
||||
// XXX this is slightly inefficient
|
||||
void cs_remove_nick(NickCore *nc)
|
||||
{
|
||||
for (registered_channel_map::const_iterator it = RegisteredChannelList.begin(); it != RegisteredChannelList.end();)
|
||||
for (registered_channel_map::const_iterator it = RegisteredChannelList.begin(), it_end = RegisteredChannelList.end(); it != it_end;)
|
||||
{
|
||||
ChannelInfo *ci = it->second;
|
||||
++it;
|
||||
|
||||
ChanAccess *access = ci->GetAccess(nc);
|
||||
if (access)
|
||||
ci->EraseAccess(access);
|
||||
|
||||
for (unsigned j = ci->GetAkickCount(); j > 0; --j)
|
||||
{
|
||||
AutoKick *akick = ci->GetAkick(j - 1);
|
||||
@@ -468,6 +464,13 @@ void cs_remove_nick(NickCore *nc)
|
||||
|
||||
if (ci->successor == nc)
|
||||
ci->successor = NULL;
|
||||
|
||||
/* Note that it is important we lookup the access for the channel after the new founder
|
||||
* has been determined incase this user was the founder and also was on the access list!
|
||||
*/
|
||||
ChanAccess *access = ci->GetAccess(nc);
|
||||
if (access)
|
||||
ci->EraseAccess(access);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user