]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mbox: Added an extra assert
authorTimo Sirainen <tss@iki.fi>
Wed, 6 May 2015 21:01:16 +0000 (00:01 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 6 May 2015 21:01:16 +0000 (00:01 +0300)
src/lib-storage/index/mbox/mbox-sync-rewrite.c

index 720b180854e94e7e448b71f8a27187eecad5a4ba..10b12a5d7fbcfe220376a11208d4da7c56268e43 100644 (file)
@@ -435,6 +435,7 @@ static int mbox_sync_read_and_move(struct mbox_sync_context *sync_ctx,
        if (first_nonexpunged && expunged_space > 0) {
                /* move From-line (after parsing headers so we don't
                   overwrite them) */
+               i_assert(mails[idx].from_offset >= expunged_space);
                if (mbox_move(sync_ctx, mails[idx].from_offset - expunged_space,
                              mails[idx].from_offset,
                              mails[idx].offset - mails[idx].from_offset) < 0)