From: Timo Sirainen Date: Fri, 28 Oct 2016 08:54:27 +0000 (+0300) Subject: auth: Fix crash when exporting passdb fields to auth-worker that have NULL values X-Git-Tag: 2.2.27~259 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b59f54e72f0b70456552dc71ad7afd7773278ff;p=thirdparty%2Fdovecot%2Fcore.git auth: Fix crash when exporting passdb fields to auth-worker that have NULL values --- diff --git a/src/auth/auth-request.c b/src/auth/auth-request.c index 3a06f08f9d..fdc9f0b8b0 100644 --- a/src/auth/auth-request.c +++ b/src/auth/auth-request.c @@ -344,8 +344,11 @@ void auth_request_export(struct auth_request *request, string_t *dest) const ARRAY_TYPE(auth_field) *fields = auth_fields_export(request->userdb_reply); const struct auth_field *field; array_foreach(fields, field) { - str_printfa(dest, "\tuserdb_%s=", field->key); - str_append_tabescaped(dest, field->value); + str_printfa(dest, "\tuserdb_%s", field->key); + if (field->value != NULL) { + str_append_c(dest, '='); + str_append_tabescaped(dest, field->value); + } } } }