Skip to content

Commit

Permalink
plugins: imap-filter-sieve: Add assertion on attempting to execute at…
Browse files Browse the repository at this point in the history
… least one script.

Coverity complains about last_script possibly being empty in
imap_sieve_filter_run_scripts(), which is actually not possible, since the
function would not be called if there is no script to execute. Added assertion
to make that clear.
  • Loading branch information
stephanbosch authored and villesavolainen committed Nov 14, 2018
1 parent 740cbc7 commit 762e55e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/plugins/imap-filter-sieve/imap-filter-sieve.c
Expand Up @@ -773,6 +773,7 @@ imap_sieve_filter_run_scripts(struct imap_filter_sieve_context *sctx,
return 1;
}

i_assert(last_script != NULL); /* at least one script is executed */
return imap_sieve_filter_handle_exec_status(sctx,
last_script, ret, keep, scriptenv->exec_status);
}
Expand Down

0 comments on commit 762e55e

Please sign in to comment.