]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: client: Add assertion to smtp_client_command_write().
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 23 Dec 2017 21:51:37 +0000 (22:51 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 23 Dec 2017 21:51:37 +0000 (22:51 +0100)
Makes sure it is not used after the command is submitted.

src/lib-smtp/smtp-client-command.c

index d96a61836d4b823a5d77f24e551be90fb46a6db9..f02a651d0c67a81ff9ab2e726a080ce45f5f0d8f 100644 (file)
@@ -721,6 +721,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);