[dovecot-cvs] dovecot/src/lib-storage/index index-sync.c,1.16,1.17

cras at procontrol.fi cras at procontrol.fi
Fri Oct 25 06:52:04 EEST 2002


Update of /home/cvs/dovecot/src/lib-storage/index
In directory danu:/tmp/cvs-serv32042

Modified Files:
	index-sync.c 
Log Message:
Don't crash either if expunge or update_flags sync_callbacks haven't been set
when syncing modify log



Index: index-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-sync.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- index-sync.c	25 Oct 2002 01:59:36 -0000	1.16
+++ index-sync.c	25 Oct 2002 02:52:02 -0000	1.17
@@ -111,6 +111,9 @@
 			seq_count = (log->seq2 - log->seq1) + 1;
 			messages -= seq_count;
 
+			if (sc->expunge == NULL)
+				break;
+
 			for (; seq_count > 0; seq_count--) {
 				sc->expunge(&ibox->box, log->seq1,
 					    sc_context);
@@ -132,6 +135,11 @@
 	/* now show the flags */
 	messages = first_flag_messages_count;
 	custom_flags = mail_custom_flags_list_get(ibox->index->custom_flags);
+
+	if (sc->update_flags == NULL) {
+		/* don't bother going through, we're not printing them anyway */
+		total_count = 0;
+	}
 
 	log = first_flag_log;
 	for (i = first_flag_change; i < total_count; i++, log++) {




More information about the dovecot-cvs mailing list