From f1d9104a99d39122dafc1a0abc0692b97ee0006c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 8 May 2003 05:09:45 +0300 Subject: [PATCH] Don't crash with invalid first_unseen_uid_lowwater --HG-- branch : HEAD --- src/lib-storage/index/index-status.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib-storage/index/index-status.c b/src/lib-storage/index/index-status.c index f554e61a2b..b37fc65d19 100644 --- a/src/lib-storage/index/index-status.c +++ b/src/lib-storage/index/index-status.c @@ -21,6 +21,10 @@ static unsigned int get_first_unseen_seq(struct mail_index *index) if (lowwater_uid == hdr->next_uid) { /* no unseen messages */ rec = NULL; + } else if (lowwater_uid > hdr->next_uid) { + index_set_corrupted(index, "first_unseen_uid_lowwater %u >= " + "next_uid %u", lowwater_uid, hdr->next_uid); + return 0; } else if (lowwater_uid != 0) { /* begin scanning from the low water mark */ rec = index->lookup_uid_range(index, lowwater_uid, -- 2.47.3