[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-rewrite.c, 1.62.2.1, 1.62.2.2

cras at dovecot.org cras at dovecot.org
Sat Jun 24 23:54:36 EEST 2006


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

Modified Files:
      Tag: branch_1_0
	mbox-sync-rewrite.c 
Log Message:
We assert-crashed in wrong conditions.



Index: mbox-sync-rewrite.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-rewrite.c,v
retrieving revision 1.62.2.1
retrieving revision 1.62.2.2
diff -u -d -r1.62.2.1 -r1.62.2.2
--- mbox-sync-rewrite.c	24 Jun 2006 20:53:36 -0000	1.62.2.1
+++ mbox-sync-rewrite.c	24 Jun 2006 20:54:34 -0000	1.62.2.2
@@ -395,9 +395,11 @@
 			return -1;
 	}
 
-	need_space = str_len(mail_ctx->header) - mail_ctx->mail.space -
-		(mail_ctx->body_offset - mail_ctx->hdr_offset);
-	i_assert(need_space == (uoff_t)-mails[idx].space);
+	if (mail_ctx->mail.space <= 0) {
+		need_space = str_len(mail_ctx->header) - mail_ctx->mail.space -
+			(mail_ctx->body_offset - mail_ctx->hdr_offset);
+		i_assert(need_space == (uoff_t)-mails[idx].space);
+	}
 
 	if (mails[idx].space == 0) {
 		/* don't touch spacing */



More information about the dovecot-cvs mailing list