1
0
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:
Adam
2011-04-27 09:26:51 -04:00
parent 0cdc628db0
commit 5d3d6bcead
2 changed files with 9 additions and 6 deletions
+8 -5
View File
@@ -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);
}
}