From d4d99f08d3cb4dc3d8451c88fe366bfd699bb37a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 4 Sep 2017 21:30:26 +0300 Subject: fixes #915 (crash in IRC processing wrongly created PING command) --- protocols/IRCG/src/commandmonitor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'protocols/IRCG/src/commandmonitor.cpp') diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 6b32bf8c42..df1316ec8b 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -261,7 +261,10 @@ void __cdecl CIrcProto::ResolveIPThread(void *di) bool CIrcProto::OnIrc_PING(const CIrcMessage* pmsg) { wchar_t szResponse[100]; - mir_snwprintf(szResponse, L"PONG %s", pmsg->parameters[0].c_str()); + if (pmsg->parameters.getCount() > 0) + mir_snwprintf(szResponse, L"PONG %s", pmsg->parameters[0].c_str()); + else + wcscpy(szResponse, L"PONG"); SendIrcMessage(szResponse); return false; } -- cgit v1.2.3