]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fix assert-crash on mailbox_copy/move() failure
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 15 Jan 2017 17:56:32 +0000 (19:56 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 15 Jan 2017 17:56:32 +0000 (19:56 +0200)
If mailbox_save_cancel() was being called outside mail_storage_copy()
it assert-crashed:

Panic: file mail-storage.c: line 2168 (mailbox_save_context_reset): assertion failed: (ctx->copying_via_save)

src/lib-storage/mail-storage.c

index 1d9b1bf95491171ffd2ec9058f0cb4aaa9f009e3..15fae033f5977b1f4c86dfc1e4d81e2f6e6e2edd 100644 (file)
@@ -2165,7 +2165,7 @@ mailbox_save_context_reset(struct mail_save_context *ctx, bool success)
                i_assert(ctx->saving || !success);
                ctx->saving = FALSE;
        } else {
-               i_assert(ctx->copying_via_save);
+               i_assert(ctx->copying_via_save || !success);
                /* We came from mailbox_copy(). saving==TRUE is possible here
                   if we also came from mailbox_save_using_mail(). Don't set
                   saving=FALSE yet in that case, because copy() is still