]> jfr.im git - irc/irssi/irssi.git/commitdiff
fix nick->host == NULL crash
authorailin-nemui <redacted>
Mon, 22 Aug 2016 10:27:10 +0000 (12:27 +0200)
committerailin-nemui <redacted>
Mon, 22 Aug 2016 10:27:10 +0000 (12:27 +0200)
src/fe-common/core/fe-messages.c

index bc2a30d6d1281f303cc148b90796f2b1a679aef7..487a57540104b171d912aa9fbddf875768198f84 100644 (file)
@@ -603,9 +603,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;
@@ -618,6 +615,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++;