]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: SETMETADATA shouldn't crash when value parameter is missing.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 3 Feb 2016 11:56:09 +0000 (13:56 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 3 Feb 2016 11:56:09 +0000 (13:56 +0200)
src/imap/cmd-setmetadata.c

index 6ef41e51bb24191c6f4bc9bb89b99a341745f1ce..b8a6aaf1f30d177a450e1d12ded407b759a8bc83 100644 (file)
@@ -80,7 +80,10 @@ cmd_setmetadata_parse_entryvalue(struct imap_setmetadata_context *ctx,
                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;