summaryrefslogtreecommitdiff
path: root/src/irc/core
diff options
context:
space:
mode:
authorNei <ailin.nemui@gmail.com>2017-10-20 13:12:27 +0000
committerailin-nemui <ailin-nemui@users.noreply.github.com>2017-10-20 15:22:32 +0200
commitf4c8018cfbd92ebf98a3bfbdd7e146e1e60130cc (patch)
treeaf21211a3fd49ead36d8c5725c7a0fa439847075 /src/irc/core
parente37d9b24979e20d03478a9d355eb7fc7ff8d246f (diff)
parent2edd816e7db13b4ac0b20df9bf7fe55ee7718215 (diff)
downloadirssi-f4c8018cfbd92ebf98a3bfbdd7e146e1e60130cc.zip
Merge branch 'fix-gl-13' into 'security'
Fix use after free when channel is destroyed inbetween being synced See merge request irssi/irssi!19
Diffstat (limited to 'src/irc/core')
-rw-r--r--src/irc/core/channels-query.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/irc/core/channels-query.c b/src/irc/core/channels-query.c
index 857ebaf0..d7dadf04 100644
--- a/src/irc/core/channels-query.c
+++ b/src/irc/core/channels-query.c
@@ -119,21 +119,22 @@ static void query_remove_all(IRC_CHANNEL_REC *channel)
int n;
rec = channel->server->chanqueries;
+ if (rec == NULL) return;
/* remove channel from query lists */
for (n = 0; n < CHANNEL_QUERIES; n++)
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);
}