Skip to content

Commit

Permalink
lib-smtp: client: Add assertion to smtp_client_command_write().
Browse files Browse the repository at this point in the history
Makes sure it is not used after the command is submitted.
  • Loading branch information
stephanbosch authored and villesavolainen committed Mar 13, 2018
1 parent ee9ceaf commit 57d3c49
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib-smtp/smtp-client-command.c
Expand Up @@ -714,6 +714,7 @@ void smtp_client_command_write(struct smtp_client_command *cmd,
{
unsigned int len = strlen(cmd_str);

i_assert(cmd->state < SMTP_CLIENT_COMMAND_STATE_SUBMITTED);
if (cmd->data == NULL)
cmd->data = str_new(cmd->pool, len + 2);
str_append(cmd->data, cmd_str);
Expand Down

0 comments on commit 57d3c49

Please sign in to comment.