[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-save.c, 1.112, 1.113

tss at dovecot.org tss at dovecot.org
Fri May 11 21:57:54 EEST 2007


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv16019/lib-storage/index/mbox

Modified Files:
	mbox-save.c 
Log Message:
Crashfix when saving mails



Index: mbox-save.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-save.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- mbox-save.c	26 Apr 2007 18:30:19 -0000	1.112
+++ mbox-save.c	11 May 2007 18:57:52 -0000	1.113
@@ -40,7 +40,7 @@
 
 	string_t *headers;
 	size_t space_end_idx;
-	uint32_t seq, next_uid, uid_validity;
+	uint32_t seq, next_uid, uid_validity, first_saved_uid;
 
 	struct istream *input;
 	struct ostream *output, *body_output;
@@ -197,12 +197,11 @@
 	hdr = mail_index_get_header(view);
 
 	ctx->next_uid = hdr->next_uid;
+	ctx->first_saved_uid = ctx->next_uid;
 	ctx->uid_validity = hdr->uid_validity;
 	ctx->synced = TRUE;
 	t->mbox_modified = TRUE;
 
-	*t->ictx.first_saved_uid = ctx->next_uid;
-
 	mail_index_view_close(&view);
 }
 
@@ -651,6 +650,8 @@
 	i_assert(ctx->finished);
 
 	if (ctx->synced) {
+		*t->ictx.first_saved_uid = ctx->first_saved_uid;
+
 		mail_index_update_header(ctx->trans,
 			offsetof(struct mail_index_header, next_uid),
 			&ctx->next_uid, sizeof(ctx->next_uid), FALSE);



More information about the dovecot-cvs mailing list