[dovecot-cvs] dovecot/src/lib-storage/index index-search.c, 1.112.2.2, 1.112.2.3

cras at dovecot.org cras at dovecot.org
Sun Jun 25 00:29:04 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv19613

Modified Files:
      Tag: branch_1_0
	index-search.c 
Log Message:
Don't crash when different search conditions reduce the search range so that
minimum sequence becomes larger than maximum..



Index: index-search.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-search.c,v
retrieving revision 1.112.2.2
retrieving revision 1.112.2.3
diff -u -d -r1.112.2.2 -r1.112.2.3
--- index-search.c	20 Jun 2006 15:29:18 -0000	1.112.2.2
+++ index-search.c	24 Jun 2006 21:29:02 -0000	1.112.2.3
@@ -836,14 +836,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)



More information about the dovecot-cvs mailing list