From e91da9e4098e449dc36eaa15354aff67650e7703 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Thu, 25 Jan 2018 16:05:47 +0100 Subject: please give us nicks --- src/fe-common/core/chat-completion.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/fe-common') diff --git a/src/fe-common/core/chat-completion.c b/src/fe-common/core/chat-completion.c index 97cd0565..c62d760d 100644 --- a/src/fe-common/core/chat-completion.c +++ b/src/fe-common/core/chat-completion.c @@ -173,6 +173,7 @@ static void sig_message_public(SERVER_REC *server, const char *msg, { CHANNEL_REC *channel; int own; + g_return_if_fail(nick != NULL); channel = channel_find(server, target); if (channel != NULL) { @@ -185,6 +186,7 @@ static void sig_message_join(SERVER_REC *server, const char *channel, const char *nick, const char *address) { CHANNEL_REC *chanrec; + g_return_if_fail(nick != NULL); chanrec = channel_find(server, channel); if (chanrec != NULL) -- cgit v1.2.3 From 0909d47e5b5ab08cd07970a374e311f7f54be547 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Thu, 25 Jan 2018 16:10:21 +0100 Subject: Check that server is still existent when using /oper --- src/fe-common/irc/fe-irc-commands.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/fe-common') diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c index 11a911d2..7a6b17a6 100644 --- a/src/fe-common/irc/fe-irc-commands.c +++ b/src/fe-common/irc/fe-irc-commands.c @@ -345,16 +345,18 @@ static void cmd_ts(const char *data) } typedef struct { - IRC_SERVER_REC *server; + char *server_tag; char *nick; } OPER_PASS_REC; static void cmd_oper_got_pass(const char *password, OPER_PASS_REC *rec) { - if (*password != '\0') - irc_send_cmdv(rec->server, "OPER %s %s", rec->nick, password); + SERVER_REC *server_rec = server_find_tag(rec->server_tag); + if (*password != '\0' && IS_IRC_SERVER(server_rec)) + irc_send_cmdv((IRC_SERVER_REC *) server_rec, "OPER %s %s", rec->nick, password); g_free(rec->nick); - g_free(rec); + g_free(rec->server_tag); + g_free(rec); } static void cmd_oper(const char *data, IRC_SERVER_REC *server) @@ -374,7 +376,7 @@ static void cmd_oper(const char *data, IRC_SERVER_REC *server) OPER_PASS_REC *rec; rec = g_new(OPER_PASS_REC, 1); - rec->server = server; + rec->server_tag = g_strdup(server->tag); rec->nick = g_strdup(*nick != '\0' ? nick : server->nick); format = format_get_text(MODULE_NAME, NULL, server, NULL, -- cgit v1.2.3