]> jfr.im git - irc/hexchat/hexchat.git/commitdiff
Fix crash on coloring NULL nicks
authorPatrick Griffis <redacted>
Sun, 18 Jun 2017 10:31:34 +0000 (06:31 -0400)
committerPatrick Griffis <redacted>
Sun, 18 Jun 2017 10:31:34 +0000 (06:31 -0400)
Fixes #2014

src/common/text.c

index eac31ba3b97c5a7db974ebac22138206ff8d7230..2677ebc4b9aa09401b6869a858c639afdb957a23 100644 (file)
@@ -2013,7 +2013,7 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
        unsigned int stripcolor_args = (chanopt_is_set (prefs.hex_text_stripcolor_msg, sess->text_strip) ? 0xFFFFFFFF : 0);
        char tbuf[NICKLEN + 4];
 
-       if (prefs.hex_text_color_nicks && (index == XP_TE_CHANACTION || index == XP_TE_CHANMSG))
+       if (a != NULL && prefs.hex_text_color_nicks && (index == XP_TE_CHANACTION || index == XP_TE_CHANMSG))
        {
                g_snprintf (tbuf, sizeof (tbuf), "\003%d%s", text_color_of (a), a);
                a = tbuf;