From 63a9d77339c59198e8d658a8dab070992134f8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 10 Feb 2015 21:58:47 +0100 Subject: [PATCH] irc: fix crash in callback of message 354 when the nick is not found in channel --- src/plugins/irc/irc-protocol.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index c68520cd7..87b1a7d5a 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -4300,11 +4300,14 @@ IRC_PROTOCOL_CALLBACK(354) } /* update account flag for nick */ - if (ptr_nick->account) - free (ptr_nick->account); - ptr_nick->account = (ptr_channel && ptr_nick && pos_account - && server->cap_account_notify) ? - strdup (pos_account) : strdup ("*"); + if (ptr_nick) + { + if (ptr_nick->account) + free (ptr_nick->account); + ptr_nick->account = (ptr_channel && pos_account + && server->cap_account_notify) ? + strdup (pos_account) : strdup ("*"); + } /* display output of who (manual who from user) */ if (!ptr_channel || (ptr_channel->checking_whox <= 0))