[dovecot-cvs] dovecot/src/lib-index mail-index-sync.c,1.79,1.80

tss at dovecot.org tss at dovecot.org
Sun Nov 12 15:20:40 UTC 2006


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

Modified Files:
	mail-index-sync.c 
Log Message:
Don't crash if syncing breaks.



Index: mail-index-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- mail-index-sync.c	15 Oct 2006 12:59:43 -0000	1.79
+++ mail-index-sync.c	12 Nov 2006 15:20:36 -0000	1.80
@@ -622,7 +622,8 @@
 	*_ctx = NULL;
 	mail_index_unlock(ctx->index, ctx->lock_id);
 
-	i_assert(!ctx->index->map->write_to_disk);
+	i_assert(ctx->index->map == NULL ||
+		 !ctx->index->map->write_to_disk);
 	mail_transaction_log_sync_unlock(ctx->index->log);
 
 	mail_index_view_close(&ctx->view);
@@ -675,8 +676,11 @@
 		}
 	}
 
-	index->sync_log_file_seq = index->map->hdr.log_file_seq;
-	index->sync_log_file_offset = index->map->hdr.log_file_int_offset;
+	if (ret == 0) {
+		index->sync_log_file_seq = index->map->hdr.log_file_seq;
+		index->sync_log_file_offset =
+			index->map->hdr.log_file_int_offset;
+	}
 
 	mail_index_sync_end(_ctx);
 	return ret;



More information about the dovecot-cvs mailing list