]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: Add assert to help static analyzers
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 22 Sep 2021 16:34:32 +0000 (19:34 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 29 Sep 2021 14:44:22 +0000 (14:44 +0000)
mdbox_sync_begin() can return 0 with sync_ctx=NULL, but not with the
parameters given here.

src/lib-storage/index/dbox-multi/mdbox-save.c

index ff6e4f77b08a2f7c74e89c00f9485ffce02b82e7..8a614e7c51faf6d8028c33ece64e2f010b317f17 100644 (file)
@@ -310,6 +310,7 @@ int mdbox_transaction_save_commit_pre(struct mail_save_context *_ctx)
                mdbox_transaction_save_rollback(_ctx);
                return -1;
        }
+       i_assert(ctx->sync_ctx != NULL);
 
        /* assign map UIDs for newly saved messages after we've successfully
           acquired all the locks. the transaction is now very unlikely to