Skip to content

Commit

Permalink
lib-smtp: params: Fix segfault occurring in smtp_param_write() when p…
Browse files Browse the repository at this point in the history
…aram->value == NULL.
  • Loading branch information
stephanbosch authored and cmouse committed Oct 10, 2018
1 parent 9dff384 commit bea8658
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib-smtp/smtp-params.c
Expand Up @@ -100,10 +100,12 @@ static bool smtp_param_value_valid(const char *value)

void smtp_param_write(string_t *out, const struct smtp_param *param)
{
i_assert(smtp_param_value_valid(param->value));
str_append(out, t_str_ucase(param->keyword));
str_append_c(out, '=');
str_append(out, param->value);
if (param->value != NULL) {
i_assert(smtp_param_value_valid(param->value));
str_append_c(out, '=');
str_append(out, param->value);
}
}

/*
Expand Down

0 comments on commit bea8658

Please sign in to comment.