diff options
Diffstat (limited to 'src/fe-common/irc')
-rw-r--r-- | src/fe-common/irc/fe-netjoin.c | 13 | ||||
-rw-r--r-- | src/fe-common/irc/fe-netsplit.c | 12 |
2 files changed, 17 insertions, 8 deletions
diff --git a/src/fe-common/irc/fe-netjoin.c b/src/fe-common/irc/fe-netjoin.c index bc39b27c..9ea633b4 100644 --- a/src/fe-common/irc/fe-netjoin.c +++ b/src/fe-common/irc/fe-netjoin.c @@ -253,12 +253,17 @@ static void sig_print_starting(TEXT_DEST_REC *dest) if (!IS_IRC_SERVER(dest->server)) return; - if (!server_ischannel(dest->server, dest->target)) - return; - rec = netjoin_find_server(IRC_SERVER(dest->server)); - if (rec != NULL && rec->netjoins != NULL) + if (rec != NULL && rec->netjoins != NULL) { + /* if netjoins 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->server, dest->target)) + return; + print_netjoins(rec, NULL); + } } static int sig_check_netjoins(void) diff --git a/src/fe-common/irc/fe-netsplit.c b/src/fe-common/irc/fe-netsplit.c index ac3330e5..258d0d57 100644 --- a/src/fe-common/irc/fe-netsplit.c +++ b/src/fe-common/irc/fe-netsplit.c @@ -255,12 +255,16 @@ static void sig_print_starting(TEXT_DEST_REC *dest) if (!IS_IRC_SERVER(dest->server)) return; - if (!server_ischannel(dest->server, dest->target)) - return; - rec = IRC_SERVER(dest->server); - if (rec->split_servers != NULL) + 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; + print_splits(rec, NULL); + } } static int sig_check_splits(void) |