diff options
author | Nei <ailin.nemui@gmail.com> | 2017-01-02 17:01:29 +0000 |
---|---|---|
committer | Nei <ailin.nemui@gmail.com> | 2017-01-02 17:01:29 +0000 |
commit | 124bcd48048762de9d17ff4f46df1cbfda9c1fb5 (patch) | |
tree | 2fc0aa2745af588ecee6197b1093ff6f07b5b399 /src/irc | |
parent | c3cca5ecf3bd86da5056b8d706a300422e59594b (diff) | |
parent | 77aab7905791823f6ce2c19b4aaacd4231324841 (diff) | |
download | irssi-124bcd48048762de9d17ff4f46df1cbfda9c1fb5.zip |
Merge branch '4-use-after-free-when-receiving-numeric-432-invalid-nick' into 'security'
avoid server_disconnect
See merge request !4
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/irc-nicklist.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) |