changeset 19704:8d034339f418

imap: SETMETADATA shouldn't crash when value parameter is missing.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Wed, 03 Feb 2016 13:56:09 +0200
parents 508490be0db3
children 9fb16176c200
files src/imap/cmd-setmetadata.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-setmetadata.c	Wed Feb 03 13:03:36 2016 +0200
+++ b/src/imap/cmd-setmetadata.c	Wed Feb 03 13:56:09 2016 +0200
@@ -80,7 +80,10 @@
 		client_send_command_error(ctx->cmd, error);
 		return -1;
 	}
-	i_assert(!IMAP_ARG_IS_EOL(&args[1]));
+	if (args[1].type == IMAP_ARG_EOL) {
+		client_send_command_error(ctx->cmd, "Entry value missing");
+		return -1;
+	}
 	if (args[1].type == IMAP_ARG_LIST) {
 		client_send_command_error(ctx->cmd, "Entry value can't be a list");
 		return -1;