summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-06-17 18:37:39 +0200
committerattilamolnar <attilamolnar@hush.com>2012-06-27 00:47:38 +0200
commit596bf6dca4800b018e46bca8f53fdf109c9b6218 (patch)
tree2f65223c2a6bd896d2871048a211e844192a8e6f
parent0023d21ce23812ad59aefc0b62aac37bd09d182e (diff)
m_cap Fix crash when a user issued a CAP CLEAR request and the CapEvent had an empty list of removed CAPs
-rw-r--r--src/modules/m_cap.cpp4
1 files changed, 3 insertions, 1 deletions
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