From: Timo Sirainen Date: Tue, 25 Mar 2025 08:57:52 +0000 (+0200) Subject: doveadm kick: Fix crash when trying to give multiple username parameters X-Git-Tag: 2.4.2~864 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7639a1074ee8adc7948301ff95fc8162d64b9356;p=thirdparty%2Fdovecot%2Fcore.git doveadm kick: Fix crash when trying to give multiple username parameters --- diff --git a/src/doveadm/doveadm-kick.c b/src/doveadm/doveadm-kick.c index cb1669d61c..e04c925825 100644 --- a/src/doveadm/doveadm-kick.c +++ b/src/doveadm/doveadm-kick.c @@ -140,6 +140,7 @@ static void cmd_kick(struct doveadm_cmd_context *cctx) ctx.conn_type = cctx->conn_type; ctx.event = cctx->event; ctx.who.pool = pool_alloconly_create("kick pids", 10240); + ctx.who.event = ctx.event; if (who_parse_args(&ctx.who, passdb_field, &dest_ip, masks) != 0) { pool_unref(&ctx.who.pool); diff --git a/src/doveadm/doveadm-who.c b/src/doveadm/doveadm-who.c index 2fbef7bb94..07fdb168ed 100644 --- a/src/doveadm/doveadm-who.c +++ b/src/doveadm/doveadm-who.c @@ -188,6 +188,8 @@ who_parse_masks(struct who_context *ctx, const char *const *masks) int who_parse_args(struct who_context *ctx, const char *alt_username_field, const struct ip_addr *dest_ip, const char *const *masks) { + i_assert(ctx->event != NULL); + if (dest_ip != NULL) ctx->filter.dest_ip = *dest_ip;