From be77a7e27e5b337f294d6283ed48c734658f25a9 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 19 Sep 2011 12:29:54 -0400 Subject: [PATCH] Bug #1334 - fixed crash on /os oper info --- modules/commands/os_oper.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/commands/os_oper.cpp b/modules/commands/os_oper.cpp index e65cb98eb..db300f1ce 100644 --- a/modules/commands/os_oper.cpp +++ b/modules/commands/os_oper.cpp @@ -108,7 +108,8 @@ class CommandOSOper : public Command { source.Reply(_("Available commands for \2%s\2:"), ot->GetName().c_str()); Anope::string buf; - for (std::list::const_iterator it = ot->GetCommands().begin(), it_end = ot->GetCommands().end(); it != it_end; ++it) + std::list cmds = ot->GetCommands(); + for (std::list::const_iterator it = cmds.begin(), it_end = cmds.end(); it != it_end; ++it) { buf += *it + " "; if (buf.length() > 400) @@ -129,7 +130,8 @@ class CommandOSOper : public Command { source.Reply(_("Available privileges for \2%s\2:"), ot->GetName().c_str()); Anope::string buf; - for (std::list::const_iterator it = ot->GetPrivs().begin(), it_end = ot->GetPrivs().end(); it != it_end; ++it) + std::list privs = ot->GetPrivs(); + for (std::list::const_iterator it = privs.begin(), it_end = privs.end(); it != it_end; ++it) { buf += *it + " "; if (buf.length() > 400)