]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 13 Mar 2018 05:01:59 +0000 (07:01 +0200)
Makes sure it is not used after the command is submitted.

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

index 486cd6a73599185ecba5b9a47c4f38ec46ec2f95..4d023ed5a76334abf6c09a96d4e7cdee9a3aadee 100644 (file)
@@ -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);