]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Don't crash with invalid first_unseen_uid_lowwater
authorTimo Sirainen <tss@iki.fi>
Thu, 8 May 2003 02:09:45 +0000 (05:09 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 8 May 2003 02:09:45 +0000 (05:09 +0300)
--HG--
branch : HEAD

src/lib-storage/index/index-status.c

index f554e61a2b30a076525423a59e1e8e0aa3831b88..b37fc65d19c79f1bc92fb1bf7c3b543604d3d8b9 100644 (file)
@@ -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,