Skip to content

Commit

Permalink
lib-sieve: redirect action: Fix lack of NULL checking in new X-Sieve-…
Browse files Browse the repository at this point in the history
…Redirected-From header comparisons.

Problem found by scan-build.
  • Loading branch information
stephanbosch committed Dec 12, 2018
1 parent 5b81342 commit 114fe5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib-sieve/cmd-redirect.c
Expand Up @@ -495,11 +495,11 @@ act_redirect_check_loop_header(const struct sieve_action_exec_env *aenv,

while (*headers != NULL) {
const char *header = t_str_trim(*headers, " \t\r\n");
if (strcmp(header, recipient) == 0) {
if (recipient != NULL && strcmp(header, recipient) == 0) {
*loop_detected_r = TRUE;
break;
}
if (strcmp(header, user_email) == 0) {
if (user_email != NULL && strcmp(header, user_email) == 0) {
*loop_detected_r = TRUE;
break;
}
Expand Down

0 comments on commit 114fe5f

Please sign in to comment.