From: Timo Sirainen Date: Mon, 3 Dec 2018 13:43:06 +0000 (+0200) Subject: maildir: Don't crash with zlib plugin when saving is aborted X-Git-Tag: 2.3.5~294 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f9bb887812cde28fb91025d9b7c7c7ca46b4f7f;p=thirdparty%2Fdovecot%2Fcore.git maildir: Don't crash with zlib plugin when saving is aborted The ostream can be finished even if the saving had already failed. It gets deleted anyway. Fixes: Panic: file ostream-zlib.c: line 37 (o_stream_zlib_close): assertion failed: (zstream->ostream.finished || zstream->ostream.ostream.stream_errno != 0 || zstream->ostream.error_handling_disabled) --- diff --git a/src/lib-storage/index/maildir/maildir-save.c b/src/lib-storage/index/maildir/maildir-save.c index 718ac39bbd..e4e98c30dc 100644 --- a/src/lib-storage/index/maildir/maildir-save.c +++ b/src/lib-storage/index/maildir/maildir-save.c @@ -510,7 +510,7 @@ static int maildir_save_finish_real(struct mail_save_context *_ctx) } path = t_strconcat(ctx->tmpdir, "/", ctx->file_last->tmp_name, NULL); - if (!ctx->failed && o_stream_finish(_ctx->data.output) < 0) { + if (o_stream_finish(_ctx->data.output) < 0) { if (!mail_storage_set_error_from_errno(storage)) { mail_set_critical(_ctx->dest_mail, "write(%s) failed: %s", path,