From: Timo Sirainen Date: Sun, 15 Jan 2017 17:56:32 +0000 (+0200) Subject: lib-storage: Fix assert-crash on mailbox_copy/move() failure X-Git-Tag: 2.3.0.rc1~2307 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c6a1ceeddee48ff682bbedaa2567d0429cd17c6;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Fix assert-crash on mailbox_copy/move() failure 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) --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 1d9b1bf954..15fae033f5 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -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