From: Timo Sirainen Date: Fri, 20 Nov 2020 10:15:18 +0000 (+0200) Subject: doveadm: When sending server logs to client, make sure ioloop isn't set to NULL X-Git-Tag: 2.3.13~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cafccc4f0f171bc639b6fb59078d80c4695f0968;p=thirdparty%2Fdovecot%2Fcore.git doveadm: When sending server logs to client, make sure ioloop isn't set to NULL This could have happened if there was any logging done outside command handling. For example a doveadm command used http-client, which has a timeout that triggers logging only after the command is finished. Fixes segfault and: Panic: file http-client.c: line 642 (http_client_context_close): assertion failed: (cctx->clients_list == NULL) --- diff --git a/src/doveadm/client-connection-tcp.c b/src/doveadm/client-connection-tcp.c index 96efa1f2bb..4ec3dc7a3c 100644 --- a/src/doveadm/client-connection-tcp.c +++ b/src/doveadm/client-connection-tcp.c @@ -80,7 +80,8 @@ doveadm_server_log_handler(const struct failure_context *ctx, /* since we can get here from just about anywhere, make sure the log ostream uses the connection's ioloop. */ - io_loop_set_current(conn->ioloop); + if (conn->ioloop != NULL) + io_loop_set_current(conn->ioloop); c = doveadm_log_type_to_char(ctx->type); corked = o_stream_is_corked(log_out);