dovecot-1.1: Expunge handler crashfix

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 12 05:27:18 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/50ebec7bd4c5
changeset: 7412:50ebec7bd4c5
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 12 05:27:14 2008 +0200
description:
Expunge handler crashfix

diffstat:

1 file changed, 2 insertions(+), 3 deletions(-)
src/lib-index/mail-index-sync-ext.c |    5 ++---

diffs (17 lines):

diff -r ed147ad1e03e -r 50ebec7bd4c5 src/lib-index/mail-index-sync-ext.c
--- a/src/lib-index/mail-index-sync-ext.c	Tue Mar 11 17:25:29 2008 +0200
+++ b/src/lib-index/mail-index-sync-ext.c	Wed Mar 12 05:27:14 2008 +0200
@@ -34,11 +34,10 @@ void mail_index_sync_init_expunge_handle
 	id_map = array_get(&ctx->view->map->ext_id_map, &id_map_count);
 	contexts = array_get_modifiable(&ctx->extra_contexts, &context_count);
 
-	i_assert(id_map_count <= rext_count);
 	i_assert(context_count >= rext_count);
-
 	for (idx_ext_id = 0; idx_ext_id < rext_count; idx_ext_id++) {
-		map_ext_id = id_map[idx_ext_id];
+		map_ext_id = idx_ext_id >= id_map_count ? (uint32_t)-1 :
+			id_map[idx_ext_id];
 		if (rext[idx_ext_id].expunge_handler == NULL ||
 		    (map_ext_id == (uint32_t)-1 &&
 		     !rext[idx_ext_id].expunge_handler_call_always))


More information about the dovecot-cvs mailing list