[dovecot-cvs] dovecot/src/lib-storage/index index-search.c, 1.116, 1.117

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


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

Modified Files:
	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.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- index-search.c	20 Jun 2006 15:29:20 -0000	1.116
+++ index-search.c	24 Jun 2006 21:29:03 -0000	1.117
@@ -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)



More information about the dovecot-cvs mailing list