dovecot-2.0: dbox: Copying messages crashed.

dovecot at dovecot.org dovecot at dovecot.org
Thu May 27 21:14:46 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/f2ece87f9fea
changeset: 11393:f2ece87f9fea
user:      Timo Sirainen <tss at iki.fi>
date:      Thu May 27 19:14:37 2010 +0100
description:
dbox: Copying messages crashed.

diffstat:

 src/lib-storage/index/dbox-single/sdbox-save.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 47f186130a4d -r f2ece87f9fea src/lib-storage/index/dbox-single/sdbox-save.c
--- a/src/lib-storage/index/dbox-single/sdbox-save.c	Thu May 27 19:06:59 2010 +0100
+++ b/src/lib-storage/index/dbox-single/sdbox-save.c	Thu May 27 19:14:37 2010 +0100
@@ -42,6 +42,7 @@
 
 	files = array_get(&ctx->files, &count);
 	i_assert(count > 0);
+	i_assert(seq - ctx->first_saved_seq < count);
 
 	return files[seq - ctx->first_saved_seq];
 }
@@ -75,6 +76,8 @@
 {
 	struct sdbox_save_context *ctx = (struct sdbox_save_context *)_ctx;
 
+	if (ctx->first_saved_seq == 0)
+		ctx->first_saved_seq = ctx->ctx.seq;
 	array_append(&ctx->files, &file, 1);
 }
 
@@ -98,9 +101,6 @@
 	ctx->ctx.cur_file = file;
 	dbox_save_begin(&ctx->ctx, input);
 
-	if (ctx->first_saved_seq == 0)
-		ctx->first_saved_seq = ctx->ctx.seq;
-
 	sdbox_save_add_file(_ctx, file);
 	return ctx->ctx.failed ? -1 : 0;
 }


More information about the dovecot-cvs mailing list