Skip to content

Commit

Permalink
lib-smtp: client: Fix potential segfault occurring after receiving RC…
Browse files Browse the repository at this point in the history
…PT reply.

Could occur when RCPT reply is received befor DATA command is sent in LMTP session.

Problem found by Coverity.
  • Loading branch information
stephanbosch authored and sirainen committed Aug 29, 2018
1 parent b442b37 commit fc73625
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-smtp/smtp-client-transaction.c
Expand Up @@ -557,7 +557,8 @@ smtp_client_transaction_rcpt_cb(const struct smtp_reply *reply,
if (array_count(&trans->rcpts) == 0) {
/* abort transaction if all recipients failed */
smtp_client_transaction_abort(trans);
} else if (conn->protocol == SMTP_PROTOCOL_LMTP) {
} else if (conn->protocol == SMTP_PROTOCOL_LMTP &&
trans->cmd_data != NULL) {
smtp_client_command_set_replies(trans->cmd_data,
array_count(&trans->rcpts));
}
Expand Down

0 comments on commit fc73625

Please sign in to comment.