[dovecot-cvs] dovecot/src/imap imap-sort.c,1.26,1.27

cras at dovecot.org cras at dovecot.org
Sun Feb 5 09:19:26 EET 2006


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv13091

Modified Files:
	imap-sort.c 
Log Message:
Minor cleanup / comment update



Index: imap-sort.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-sort.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- imap-sort.c	14 Jan 2006 18:47:21 -0000	1.26
+++ imap-sort.c	5 Feb 2006 07:19:24 -0000	1.27
@@ -55,7 +55,7 @@
 static void mail_sort_input(struct sort_context *ctx, struct mail *mail);
 static void mail_sort_flush(struct sort_context *ctx);
 
-static enum mail_sort_type
+static void
 mail_sort_normalize(const enum mail_sort_type *input, buffer_t *output)
 {
         enum mail_sort_type type, mask = 0;
@@ -83,8 +83,6 @@
 
 	type = MAIL_SORT_END;
 	buffer_append(output, &type, sizeof(type));
-
-	return mask;
 }
 
 static enum mail_sort_type
@@ -205,7 +203,9 @@
 
 	ctx = t_new(struct sort_context, 1);
 
-	/* normalize sorting program */
+	/* normalize sorting program. note that although we're using a hard
+	   buffer size here, it shouldn't be possible to overflow it since
+	   the normalized sort program can't exceed MAX_SORT_PROGRAM_SIZE. */
 	buf = buffer_create_data(pool_datastack_create(),
 				 norm_prog, sizeof(norm_prog));
 	mail_sort_normalize(sort_program, buf);



More information about the dovecot-cvs mailing list