From 3c29b4440841e867fe804ec5351884d90d9d8bcf Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Thu, 25 Aug 2016 04:24:07 +0200 Subject: [PATCH] Merge pull request #529 from ailin-nemui/issue500 fix nick->host == NULL crash --- src/fe-common/core/fe-messages.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c index 3240fd10..8ad83753 100644 --- a/src/fe-common/core/fe-messages.c +++ b/src/fe-common/core/fe-messages.c @@ -602,9 +602,6 @@ static void sig_nicklist_new(CHANNEL_REC *channel, NICK_REC *nick) char *nickhost, *p; int n; - if (nick->host == NULL) - return; - firstnick = g_hash_table_lookup(channel->nicks, nick->nick); if (firstnick->next == NULL) return; @@ -617,6 +614,9 @@ static void sig_nicklist_new(CHANNEL_REC *channel, NICK_REC *nick) return; /* nope, we have it */ } + if (nick->host == NULL) + return; + /* identical nick already exists, have to change it somehow.. */ p = strchr(nick->host, '@'); if (p == NULL) p = nick->host; else p++;