dovecot-1.2: pop3: Treat invalid command parameters also as comm...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Jan 14 18:13:19 EET 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/e6a58515d86d
changeset: 8623:e6a58515d86d
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 2fa464fd3aab -r e6a58515d86d 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
@@ -99,7 +99,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));
@@ -162,7 +162,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]);
@@ -421,7 +421,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;
@@ -487,9 +487,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;
@@ -587,7 +587,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;
}
}
@@ -644,12 +644,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