From 0a2af0ab6256f5ccbbd81e62fabfc8fa6022995b Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Fri, 17 May 2013 02:08:34 +0200 Subject: Fix crash when using global username for QuakeNet --- src/common/proto-irc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index b5c68e82..651125e0 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -1097,8 +1097,14 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[]) if (!strncmp (text, "CHALLENGE ", 10)) /* QuakeNet CHALLENGEAUTH upon our request */ { - response = challengeauth_response (((ircnet *)serv->network)->user, serv->password, word[5]); - tcp_sendf (serv, "PRIVMSG %s :CHALLENGEAUTH %s %s %s\r\n", CHALLENGEAUTH_NICK, ((ircnet *)serv->network)->user, response, CHALLENGEAUTH_ALGO); + response = challengeauth_response (((ircnet *)serv->network)->user ? ((ircnet *)serv->network)->user : prefs.hex_irc_user_name, serv->password, word[5]); + + tcp_sendf (serv, "PRIVMSG %s :CHALLENGEAUTH %s %s %s\r\n", + CHALLENGEAUTH_NICK, + ((ircnet *)serv->network)->user ? ((ircnet *)serv->network)->user : prefs.hex_irc_user_name, + response, + CHALLENGEAUTH_ALGO); + g_free (response); } -- cgit 1.4.1