mirror of
https://github.com/anope/anope.git
synced 2026-06-29 17:56:37 +02:00
Fix an iterator invalidation issue in cs_set and ns_set.
This commit is contained in:
@@ -1146,7 +1146,7 @@ public:
|
||||
if (c->ci && keep_modes.HasExt(c->ci))
|
||||
{
|
||||
Channel::ModeList ml = c->ci->last_modes;
|
||||
for (const auto &[last_mode, last_value] : c->ci->last_modes)
|
||||
for (const auto &[last_mode, last_value] : ml)
|
||||
c->SetMode(c->ci->WhoSends(), last_mode, last_value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1354,7 +1354,8 @@ public:
|
||||
{
|
||||
if (keep_modes.HasExt(u->Account()))
|
||||
{
|
||||
for (const auto &[last_mode, last_value] : u->Account()->last_modes)
|
||||
User::ModeList modes = u->Account()->last_modes;
|
||||
for (const auto &[last_mode, last_value] : modes)
|
||||
{
|
||||
UserMode *um = ModeManager::FindUserModeByName(last_mode);
|
||||
/* if the null user can set the mode, then it's probably safe */
|
||||
|
||||
Reference in New Issue
Block a user