]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm kick: Fix crash when trying to give multiple username parameters
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 25 Mar 2025 08:57:52 +0000 (10:57 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Sun, 30 Mar 2025 19:41:17 +0000 (19:41 +0000)
src/doveadm/doveadm-kick.c
src/doveadm/doveadm-who.c

index cb1669d61c8f879e55ec8893e7d18155cd6c1aac..e04c925825bd1d2b810689e2bc35e0e8c8472a1b 100644 (file)
@@ -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);
index 2fbef7bb94f436630535aac098e76a80d4fbb8b7..07fdb168ed98e3acdd92c41e960793c3ab34b2f2 100644 (file)
@@ -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;