Skip to content

Commit

Permalink
lib-sieve: Always check the result returned from smtp_address_init_fr…
Browse files Browse the repository at this point in the history
…om_msg().
  • Loading branch information
stephanbosch committed May 4, 2018
1 parent 518dc8b commit 483d8a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions src/lib-sieve/plugins/notify/cmd-notify.c
Expand Up @@ -747,11 +747,7 @@ static bool act_notify_send

if ( (aenv->flags & SIEVE_EXECUTE_FLAG_NO_ENVELOPE) == 0 &&
sieve_message_get_sender(aenv->msgctx) != NULL ) {
struct smtp_address postmaster;

smtp_address_init_from_msg(&postmaster,
sieve_get_postmaster(senv));
sctx = sieve_smtp_start(senv, &postmaster);
sctx = sieve_smtp_start(senv, sieve_get_postmaster_smtp(senv));
} else {
sctx = sieve_smtp_start(senv, NULL);
}
Expand Down
8 changes: 4 additions & 4 deletions src/lib-sieve/plugins/vacation/cmd-vacation.c
Expand Up @@ -863,8 +863,8 @@ static inline bool _contains_my_address
struct smtp_address addr;

i_assert(msg_addr->mailbox != NULL);
smtp_address_init_from_msg(&addr, msg_addr);
if ( smtp_address_equals(&addr, my_address) ) {
if ( smtp_address_init_from_msg(&addr, msg_addr) >= 0 &&
smtp_address_equals(&addr, my_address) ) {
result = TRUE;
break;
}
Expand Down Expand Up @@ -926,8 +926,8 @@ static int _get_full_reply_recipient
if (!matched) {
i_assert(addr->mailbox != NULL);

smtp_address_init_from_msg(&saddr, addr);
matched = smtp_address_equals(smtp_to, &saddr);
matched = ( smtp_address_init_from_msg(&saddr, addr) >= 0 &&
smtp_address_equals(smtp_to, &saddr) );
}

if (matched) {
Expand Down

0 comments on commit 483d8a7

Please sign in to comment.