[dovecot-cvs] dovecot/src/lib-index mail-transaction-log.c, 1.75, 1.76

cras at dovecot.org cras at dovecot.org
Sat Dec 4 23:57:38 EET 2004


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv13410

Modified Files:
	mail-transaction-log.c 
Log Message:
Don't crash with assert if transaction log was truncated unexpectedly.



Index: mail-transaction-log.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-transaction-log.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- mail-transaction-log.c	24 Nov 2004 20:41:35 -0000	1.75
+++ mail-transaction-log.c	4 Dec 2004 21:57:36 -0000	1.76
@@ -814,9 +814,8 @@
 	}
 
 	if (file->mmap_base != NULL && (uoff_t)st.st_size == file->mmap_size &&
-	    file->buffer_offset <= start_offset) {
+	    file->buffer_offset <= start_offset && end_offset == (uoff_t)-1) {
 		/* it's all mmaped already */
-		i_assert(end_offset == (uoff_t)-1);
 		if (mail_transaction_log_file_sync(file) < 0)
 			return -1;
 		return 1;



More information about the dovecot-cvs mailing list