From 2edd816e7db13b4ac0b20df9bf7fe55ee7718215 Mon Sep 17 00:00:00 2001 From: Joseph Bisch Date: Sun, 8 Oct 2017 22:02:44 -0400 Subject: Fix segfault in query_remove_all It is possible for rec to be NULL in query_remove_all, resulting in a segfault. So return without doing anything if rec is NULL. --- src/irc/core/channels-query.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/irc') diff --git a/src/irc/core/channels-query.c b/src/irc/core/channels-query.c index d161aec1..d7dadf04 100644 --- a/src/irc/core/channels-query.c +++ b/src/irc/core/channels-query.c @@ -119,6 +119,7 @@ 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++) -- cgit v1.2.3