]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fix potential hang when client sends too long APPEND line
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 29 Oct 2024 09:20:02 +0000 (11:20 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 29 Oct 2024 14:40:50 +0000 (14:40 +0000)
src/imap/cmd-append.c

index 282f1f5f0270b679e1c36e1d99386362febd5612..30ac9a67b62ff7fc43022b8f1c5b47688732d771 100644 (file)
@@ -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);