diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2017-10-08 19:47:50 +0200 |
---|---|---|
committer | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2017-10-08 19:48:11 +0200 |
commit | 49ace3251b79a9e97c6e4d0bc640f9143dc71b90 (patch) | |
tree | 5c8074bebe67f30e21e7ae6cf09e5178432625c2 /src | |
parent | 016fd344362ddcc4b1a0781df9ac2416acc54e69 (diff) | |
download | irssi-49ace3251b79a9e97c6e4d0bc640f9143dc71b90.zip |
fix uaf in chanquery module
the chanquery needs to be removed in any case if a channel rec is
destroyed, regardless of any state
Fixes GL#13
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/core/channels-query.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/irc/core/channels-query.c b/src/irc/core/channels-query.c index 857ebaf0..d161aec1 100644 --- a/src/irc/core/channels-query.c +++ b/src/irc/core/channels-query.c @@ -125,15 +125,15 @@ static void query_remove_all(IRC_CHANNEL_REC *channel) rec->queries[n] = g_slist_remove(rec->queries[n], channel); rec->current_queries = g_slist_remove(rec->current_queries, channel); - query_check(channel->server); + if (!channel->server->disconnected) + query_check(channel->server); } static void sig_channel_destroyed(IRC_CHANNEL_REC *channel) { g_return_if_fail(channel != NULL); - if (IS_IRC_CHANNEL(channel) && !channel->server->disconnected && - !channel->synced) + if (IS_IRC_CHANNEL(channel)) query_remove_all(channel); } |