Skip to content

Commit

Permalink
imap: Fix potential hang when client sends too long APPEND line
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen authored and cmouse committed Oct 29, 2024
1 parent 06446b4 commit bfd7c60
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/imap/cmd-append.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit bfd7c60

Please sign in to comment.