Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5738:9f2e5701105f HEAD
Log an error if cache offset is tried to be updated with itself.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 14 Jun 2007 05:06:35 +0300 |
parents | 615a8c31ff47 |
children | 94161a726c8b |
files | src/lib-index/mail-cache-sync-update.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-cache-sync-update.c Thu Jun 14 04:57:22 2007 +0300 +++ b/src/lib-index/mail-cache-sync-update.c Thu Jun 14 05:06:35 2007 +0300 @@ -140,6 +140,12 @@ return 1; } + if (*old_cache_offset == *new_cache_offset) { + mail_index_sync_set_corrupted(sync_ctx, + "Cache offset replaced with itself"); + return -1; + } + if (mail_cache_link(cache, *old_cache_offset, *new_cache_offset) < 0) return -1;