]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: params: Fix segfault occurring in smtp_param_write() when param->value...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 16 Sep 2018 19:55:58 +0000 (21:55 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 10 Oct 2018 10:20:37 +0000 (10:20 +0000)
src/lib-smtp/smtp-params.c

index 3c8178ef585285082b88ff717462f09a58b0981e..8e9786f7659b4a7df905f756c3124e6174d35459 100644 (file)
@@ -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);
+       }
 }
 
 /*