From: Timo Sirainen Date: Tue, 17 Jun 2008 09:36:15 +0000 (+0300) Subject: Maildir saving: Fixed a potential crash when saving a mail with keywords. X-Git-Tag: 1.2.alpha1~284 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=93a4b979557ef4acfe0d075bc6062d7520c8f22c;p=thirdparty%2Fdovecot%2Fcore.git Maildir saving: Fixed a potential crash when saving a mail with keywords. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/maildir/maildir-save.c b/src/lib-storage/index/maildir/maildir-save.c index b7a39726c4..bf5d80287f 100644 --- a/src/lib-storage/index/maildir/maildir-save.c +++ b/src/lib-storage/index/maildir/maildir-save.c @@ -608,15 +608,14 @@ maildir_transaction_save_commit_pre_sync(struct maildir_save_context *ctx) if (maildir_sync_index_begin(mbox, NULL, &ctx->sync_ctx) < 0) return -1; + ctx->keywords_sync_ctx = + maildir_sync_get_keywords_sync_ctx(ctx->sync_ctx); if (maildir_sync_header_refresh(mbox) < 0) return -1; if (maildir_uidlist_refresh_fast_init(mbox->uidlist) < 0) return 1; - ctx->keywords_sync_ctx = - maildir_sync_get_keywords_sync_ctx(ctx->sync_ctx); - /* now that uidlist is locked, make sure all the existing mails have been added to index. we don't really look into the maildir, just add all the new mails listed in