From 596bf6dca4800b018e46bca8f53fdf109c9b6218 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sun, 17 Jun 2012 18:37:39 +0200 Subject: [PATCH] m_cap Fix crash when a user issued a CAP CLEAR request and the CapEvent had an empty list of removed CAPs --- src/modules/m_cap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index a905f2a37..662e128a4 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -108,7 +108,9 @@ class CommandCAP : public Command reghold.set(user, 1); Data.Send(); - std::string Result = irc::stringjoiner(" ", Data.ack, 0, Data.ack.size() - 1).GetJoined(); + std::string Result; + if (!Data.ack.empty()) + Result = irc::stringjoiner(" ", Data.ack, 0, Data.ack.size() - 1).GetJoined(); user->WriteServ("CAP %s ACK :%s", user->nick.c_str(), Result.c_str()); } else -- 2.39.5