dovecot-2.1: imap: Don't allow FETCH items list to be empty.

dovecot at dovecot.org dovecot at dovecot.org
Mon Apr 9 09:53:20 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/19e09ab09383
changeset: 14397:19e09ab09383
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Apr 09 09:53:13 2012 +0300
description:
imap: Don't allow FETCH items list to be empty.

diffstat:

 src/imap/cmd-fetch.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r 366b9e5fc85c -r 19e09ab09383 src/imap/cmd-fetch.c
--- a/src/imap/cmd-fetch.c	Mon Apr 09 08:17:52 2012 +0300
+++ b/src/imap/cmd-fetch.c	Mon Apr 09 09:53:13 2012 +0300
@@ -57,6 +57,11 @@
 	} else {
 		*next_arg_r = arg + 1;
 		arg = imap_arg_as_list(arg);
+		if (IMAP_ARG_IS_EOL(arg)) {
+			client_send_command_error(ctx->cmd,
+						  "FETCH list is empty.");
+			return FALSE;
+		}
 		while (imap_arg_get_atom(arg, &str)) {
 			str = t_str_ucase(str);
 			arg++;


More information about the dovecot-cvs mailing list