]> 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 09:38:30 +0000 (12:38 +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 409b3ceee93ef301bb040288505d26b649026f03..1e469a438c2a1aa5b30f5c582c665880d2d3342d 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;
 }