changeset 4438:00db36e1b734 HEAD

Don't crash when different search conditions reduce the search range so that minimum sequence becomes larger than maximum..
author Timo Sirainen <tss@iki.fi>
date Sun, 25 Jun 2006 00:29:03 +0300
parents a0066aa9678b
children 12b5fbb3a05c
files src/lib-storage/index/index-search.c
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-search.c	Sun Jun 25 00:03:13 2006 +0300
+++ b/src/lib-storage/index/index-search.c	Sun Jun 25 00:29:03 2006 +0300
@@ -837,14 +837,11 @@
 		ctx->seq1 = 1;
 		ctx->seq2 = hdr->messages_count;
 	}
-	if (ctx->seq1 == (uint32_t)-1) {
+	if (ctx->seq1 > ctx->seq2) {
 		/* no matches */
-		i_assert(ctx->seq2 == 0);
 		return 0;
 	}
 
-	i_assert(ctx->seq1 <= ctx->seq2);
-
 	/* UNSEEN and DELETED in root search level may limit the range */
 	ret = search_limit_by_flags(ctx, hdr, args, &ctx->seq1, &ctx->seq2);
 	if (ret < 0)