]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fixed assert-crash in some cache locking race conditions.
authorTimo Sirainen <tss@iki.fi>
Tue, 7 Oct 2014 17:13:36 +0000 (20:13 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 7 Oct 2014 17:13:36 +0000 (20:13 +0300)
If mail_index_map() is being called, we can't refresh the index or it'll
crash. It wouldn't help anyway, since the index was just refreshed.

src/lib-index/mail-cache.c

index 4d3df22dfae90f3135b293e7e816831f65036d32..5a65ec8f460c5755122d62e79cb662ca89a6d2fe 100644 (file)
@@ -659,7 +659,7 @@ mail_cache_lock_full(struct mail_cache *cache, bool nonblock)
                        break;
                /* mismatch. try refreshing index once. if that doesn't help,
                   we can't use the cache. */
-               if (i > 0) {
+               if (i > 0 || cache->index->mapping) {
                        mail_cache_unlock_file(cache);
                        return 0;
                }