Skip to content

Commit

Permalink
submission: Actively enforce message size limit while copying message…
Browse files Browse the repository at this point in the history
… data.
  • Loading branch information
stephanbosch authored and cmouse committed May 12, 2018
1 parent 9403767 commit ad7d4f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/submission/cmd-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ int cmd_data_continue(void *conn_ctx, struct smtp_server_cmd_ctx *cmd,
size_t size;
int ret;

while ((ret = i_stream_read_more(data_input, &data, &size)) > 0)
while ((ret = i_stream_read_more(data_input, &data, &size)) > 0) {
i_stream_skip(data_input, size);
if (!smtp_server_cmd_data_check_size(cmd))
return -1;
}

if (ret == 0)
return 0;
Expand Down

0 comments on commit ad7d4f7

Please sign in to comment.