[dovecot-cvs]
dovecot/src/lib-storage/index/mbox mbox-sync-update.c, 1.41, 1.42
cras at dovecot.org
cras at dovecot.org
Sun Jan 8 23:29:42 EET 2006
Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv944/src/lib-storage/index/mbox
Modified Files:
mbox-sync-update.c
Log Message:
"Free space offset" wasn't updated when headers were moved around, causing
assert crashes.
Index: mbox-sync-update.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-update.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- mbox-sync-update.c 28 Oct 2005 14:32:35 -0000 1.41
+++ mbox-sync-update.c 8 Jan 2006 21:29:37 -0000 1.42
@@ -44,6 +44,15 @@
ctx->hdr_pos[i] += diff;
}
+ if (ctx->mail.space > 0) {
+ i_assert(ctx->mail.offset + ctx->mail.space <= pos ||
+ ctx->mail.offset > pos + have);
+ if (ctx->mail.offset > pos) {
+ /* free space offset moves */
+ ctx->mail.offset += diff;
+ }
+ }
+
if (diff < 0)
str_delete(ctx->header, pos, -diff);
else {
More information about the dovecot-cvs
mailing list