1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-15 04:28:09 -04:00

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
This commit is contained in:
ailin-nemui 2017-10-08 19:47:50 +02:00
parent 016fd34436
commit 49ace3251b

View File

@ -125,6 +125,7 @@ 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);
if (!channel->server->disconnected)
query_check(channel->server);
}
@ -132,8 +133,7 @@ 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);
}