From: Timo Sirainen Date: Tue, 29 Oct 2024 09:20:02 +0000 (+0200) Subject: imap: Fix potential hang when client sends too long APPEND line X-Git-Tag: 2.4.0~1427 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bfd7c60928161ccfea99f463f57e4914563cb0f6;p=thirdparty%2Fdovecot%2Fcore.git imap: Fix potential hang when client sends too long APPEND line --- diff --git a/src/imap/cmd-append.c b/src/imap/cmd-append.c index 282f1f5f02..30ac9a67b6 100644 --- a/src/imap/cmd-append.c +++ b/src/imap/cmd-append.c @@ -111,15 +111,17 @@ static void client_input_append(struct client_command_context *cmd) client_send_command_error(cmd, "Too long argument."); cmd->param_error = TRUE; client_command_free(&cmd); - return; + break; + default: + o_stream_cork(client->output); + finished = command_exec(cmd); + if (!finished) + (void)client_handle_unfinished_cmd(cmd); + else + client_command_free(&cmd); + break; } - o_stream_cork(client->output); - finished = command_exec(cmd); - if (!finished) - (void)client_handle_unfinished_cmd(cmd); - else - client_command_free(&cmd); cmd_sync_delayed(client); o_stream_uncork(client->output);