]> jfr.im git - irc/irssi/irssi.git/commitdiff
Merge pull request #529 from ailin-nemui/issue500
authorailin-nemui <redacted>
Thu, 25 Aug 2016 02:24:07 +0000 (04:24 +0200)
committerailin-nemui <redacted>
Wed, 14 Sep 2016 07:44:02 +0000 (09:44 +0200)
fix nick->host == NULL crash

src/fe-common/core/fe-messages.c

index 3240fd10803acaf360923550d4e49493800ad45c..8ad837533a331089fad59ce6374ff0090a65b89d 100644 (file)
@@ -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++;