From: Timo Sirainen Date: Tue, 2 Mar 2010 13:42:50 +0000 (+0200) Subject: mdbox: Don't assert-cras if refcount in map file is too low. X-Git-Tag: 2.0.beta4~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5d17f9b1224f496f18b45579a4253df3ae0dbba;p=thirdparty%2Fdovecot%2Fcore.git mdbox: Don't assert-cras if refcount in map file is too low. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/dbox-multi/mdbox-map.c b/src/lib-storage/index/dbox-multi/mdbox-map.c index bc09d51f26..db222c2b33 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-map.c +++ b/src/lib-storage/index/dbox-multi/mdbox-map.c @@ -427,7 +427,11 @@ int dbox_map_update_refcounts(struct dbox_map_transaction_context *ctx, ctx->changed = TRUE; cur_diff += mail_index_atomic_inc_ext(ctx->trans, seq, map->ref_ext_id, diff); - i_assert(cur_diff >= 0); + if (cur_diff < 0) { + dbox_map_set_corrupted(map, + "map_uid=%u refcount too low", *uidp); + return -1; + } if (cur_diff >= 32768) { /* we're getting close to the 64k limit. fail early to make it less likely that two processes increase