Mercurial > dovecot > core-2.2
changeset 8623:e6a58515d86d HEAD
pop3: Treat invalid command parameters also as command errors
that will cause disconnection after enough errors.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 14 Jan 2009 10:47:47 -0500 |
parents | 2fa464fd3aab |
children | 16f4752882b9 |
files | src/pop3/commands.c |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ if (ret == 0 && ctx->message == 0) { /* output is being buffered, continue when there's more space */ - return 0; + return FALSE; } } @@ -644,12 +644,12 @@ 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))