dovecot-1.1: pop3: Treat invalid command parameters also as comm...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jan 14 18:12:20 EET 2009


details:   http://hg.dovecot.org/dovecot-1.1/rev/874bf3a4bbdc
changeset: 8093:874bf3a4bbdc
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jan 14 10:47:47 2009 -0500
description:
pop3: Treat invalid command parameters also as command errors
that will cause disconnection after enough errors.

diffstat:

1 file changed, 8 insertions(+), 8 deletions(-)
src/pop3/commands.c |   16 ++++++++--------

diffs (66 lines):

diff -r 410f0dcc1219 -r 874bf3a4bbdc src/pop3/commands.c
--- a/src/pop3/commands.c	Tue Jan 13 16:55:03 2009 -0500
+++ b/src/pop3/commands.c	Wed Jan 14 10:47:47 2009 -0500
@@ -98,7 +98,7 @@ static int cmd_dele(struct client *clien
 	unsigned int msgnum;
 
 	if (get_msgnum(client, args, &msgnum) == NULL)
-		return 0;
+		return -1;
 
 	if (!client->deleted) {
 		client->deleted_bitmask = i_malloc(MSGS_BITMASK_SIZE(client));
@@ -161,7 +161,7 @@ static int cmd_list(struct client *clien
 		unsigned int msgnum;
 
 		if (get_msgnum(client, args, &msgnum) == NULL)
-			return 0;
+			return -1;
 
 		client_send_line(client, "+OK %u %"PRIuUOFF_T, msgnum+1,
 				 client->message_sizes[msgnum]);
@@ -414,7 +414,7 @@ static int cmd_retr(struct client *clien
 	unsigned int msgnum;
 
 	if (get_msgnum(client, args, &msgnum) == NULL)
-		return 0;
+		return -1;
 
 	if (client->last_seen <= msgnum)
 		client->last_seen = msgnum+1;
@@ -485,9 +485,9 @@ static int cmd_top(struct client *client
 
 	args = get_msgnum(client, args, &msgnum);
 	if (args == NULL)
-		return 0;
+		return -1;
 	if (get_size(client, args, &max_lines) == NULL)
-		return 0;
+		return -1;
 
 	client->top_count++;
 	client->byte_counter = &client->top_bytes;
@@ -588,7 +588,7 @@ static bool list_uids_iter(struct client
 		if (ret == 0 && ctx->message == 0) {
 			/* output is being buffered, continue when there's
 			   more space */
-			return 0;
+			return FALSE;
 		}
 	}
 
@@ -650,12 +650,12 @@ static int cmd_uidl(struct client *clien
 	if (*args == '\0') {
 		client_send_line(client, "+OK");
 		ctx = cmd_uidl_init(client, 0);
-		list_uids_iter(client, ctx);
+		(void)list_uids_iter(client, ctx);
 	} else {
 		unsigned int msgnum;
 
 		if (get_msgnum(client, args, &msgnum) == NULL)
-			return 0;
+			return -1;
 
 		ctx = cmd_uidl_init(client, msgnum+1);
 		if (!list_uids_iter(client, ctx))


More information about the dovecot-cvs mailing list