]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Extra safety - initialize cmd_input_fd to -1
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 8 Aug 2016 09:36:48 +0000 (12:36 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 8 Aug 2016 16:30:06 +0000 (19:30 +0300)
Just to be sure it's never attempted to be accessed as 0 (stdin) before
being initialized. (It didn't happen with current code as far as I know.)

src/doveadm/doveadm-mail.c

index 1c6c396ef9ae5497816371efaf2f97e2e0e5c61c..3044d10eef6cf376d373aa10bf7f6f5859ad37b5 100644 (file)
@@ -125,6 +125,7 @@ doveadm_mail_cmd_alloc_size(size_t size)
        pool = pool_alloconly_create("doveadm mail cmd", 1024);
        ctx = p_malloc(pool, size);
        ctx->pool = pool;
+       ctx->cmd_input_fd = -1;
        return ctx;
 }