From 77aab7905791823f6ce2c19b4aaacd4231324841 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Mon, 19 Dec 2016 21:16:37 +0100 Subject: avoid server_disconnect Closes #4 --- src/irc/core/irc-nicklist.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/irc/core') diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c index b22f3269..1cb1f3e9 100644 --- a/src/irc/core/irc-nicklist.c +++ b/src/irc/core/irc-nicklist.c @@ -314,7 +314,11 @@ static void event_whois_ircop(SERVER_REC *server, const char *data) static void event_nick_invalid(IRC_SERVER_REC *server, const char *data) { if (!server->connected) - server_disconnect((SERVER_REC *) server); + /* we used to call server_disconnect but that crashes + irssi because of undefined memory access. instead, + indicate that the connection should be dropped and + let the irc method to the clean-up. */ + server->connection_lost = server->no_reconnect = TRUE; } static void event_nick_in_use(IRC_SERVER_REC *server, const char *data) -- cgit v1.2.3 From 508d2e0860992d6906b5a7b73017edbaa8c94d98 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Mon, 19 Dec 2016 16:06:13 +0100 Subject: bail out if nick is NULL in irc_query_find Closes #1 --- src/irc/core/irc-queries.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/irc/core') diff --git a/src/irc/core/irc-queries.c b/src/irc/core/irc-queries.c index 12861744..77a5289d 100644 --- a/src/irc/core/irc-queries.c +++ b/src/irc/core/irc-queries.c @@ -45,6 +45,8 @@ QUERY_REC *irc_query_find(IRC_SERVER_REC *server, const char *nick) { GSList *tmp; + g_return_val_if_fail(nick != NULL, NULL); + for (tmp = server->queries; tmp != NULL; tmp = tmp->next) { QUERY_REC *rec = tmp->data; -- cgit v1.2.3