Skip to content

Commit

Permalink
doveadm: Do not crash doveadm-server if input file missing
Browse files Browse the repository at this point in the history
save commands expects valid input file for it to work,
if we are not running for cli, and input file is not
provided, provide EINVAL error to caller via i_stream_error.
  • Loading branch information
cmouse authored and GitLab committed Mar 16, 2017
1 parent 3dffceb commit bb0484f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/doveadm/doveadm-mail.c
Expand Up @@ -227,6 +227,11 @@ void doveadm_mail_get_input(struct doveadm_mail_cmd_context *ctx)
if (ctx->cmd_input != NULL)
return;

if (!ctx->cli && ctx->conn == NULL) {
ctx->cmd_input = i_stream_create_error_str(EINVAL, "Input stream missing (provide with file parameter)");
return;
}

if (ctx->conn != NULL)
inputs[0] = i_stream_create_dot(ctx->conn->input, FALSE);
else {
Expand Down

0 comments on commit bb0484f

Please sign in to comment.