From e7fc8fa907ee7841372285de57118844abf0f883 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 18 Feb 2011 13:06:28 +0100 Subject: [PATCH] CUser::AddCTCPReply(): Reject CTCP requests containing spaces CTCP requests can't contain spaces so it's useless to specify rules for those. This doesn't affect any of the existing callers because those use Token(0) for generating the first argument to this function. Signed-off-by: Uli Schlachter --- User.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/User.cpp b/User.cpp index 1c06570b..31d2b62a 100644 --- a/User.cpp +++ b/User.cpp @@ -1253,10 +1253,14 @@ void CUser::SetIRCNick(const CNick& n) { } bool CUser::AddCTCPReply(const CString& sCTCP, const CString& sReply) { + // Reject CTCP requests containing spaces + if (sCTCP.find_first_of(' ') != CString::npos) { + return false; + } + // Reject empty CTCP requests if (sCTCP.empty()) { return false; } - m_mssCTCPReplies[sCTCP.AsUpper()] = sReply; return true; }