1
0
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:
Sadie Powell
2024-05-18 16:35:14 +01:00
parent 9d68b29c9e
commit 18e9e12261
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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);
}
}
+2 -1
View File
@@ -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 */