summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/fe-netsplit.c
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2018-01-25 15:33:24 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2018-02-09 13:02:00 +0100
commit5c5ed64180a6b76315ee7b8c6000ee64ad5877a7 (patch)
tree53cd1c09645be36e148e898d51be3ff89d78a7f0 /src/fe-common/irc/fe-netsplit.c
parent946876b1e9db5d764cecb3f884fc3075765dc94d (diff)
downloadirssi-5c5ed64180a6b76315ee7b8c6000ee64ad5877a7.zip
try to make sure the server is still good enough to call ischannel when printing netsplit/join
Diffstat (limited to 'src/fe-common/irc/fe-netsplit.c')
-rw-r--r--src/fe-common/irc/fe-netsplit.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/fe-common/irc/fe-netsplit.c b/src/fe-common/irc/fe-netsplit.c
index edd3fc34..258d0d57 100644
--- a/src/fe-common/irc/fe-netsplit.c
+++ b/src/fe-common/irc/fe-netsplit.c
@@ -247,16 +247,23 @@ static int check_server_splits(IRC_SERVER_REC *server)
message before it. */
static void sig_print_starting(TEXT_DEST_REC *dest)
{
- GSList *tmp;
+ IRC_SERVER_REC *rec;
if (printing_splits)
return;
- for (tmp = servers; tmp != NULL; tmp = tmp->next) {
- IRC_SERVER_REC *rec = tmp->data;
+ if (!IS_IRC_SERVER(dest->server))
+ return;
+
+ rec = IRC_SERVER(dest->server);
+ if (rec->split_servers != NULL) {
+ /* if split_servers exists, the server rec should be
+ still valid. otherwise, calling server->ischannel
+ may not be safe. */
+ if (dest->target != NULL && !server_ischannel((SERVER_REC *) rec, dest->target))
+ return;
- if (IS_IRC_SERVER(rec) && rec->split_servers != NULL)
- print_splits(rec, NULL);
+ print_splits(rec, NULL);
}
}