From 79fff45046397ba48c8693d5f37a1fd93096987f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 9 Sep 2016 17:55:20 +0300 Subject: [PATCH] lib-storage: Fix potential crash when userdb-returns "key+=value" for a nonexistent setting. type would have also happened to be initialized to SET_STR for the crash to happen. --- src/lib-storage/mail-storage-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib-storage/mail-storage-service.c b/src/lib-storage/mail-storage-service.c index 3d21a112b8..14f6380ed4 100644 --- a/src/lib-storage/mail-storage-service.c +++ b/src/lib-storage/mail-storage-service.c @@ -175,7 +175,7 @@ static int set_line(struct mail_storage_service_ctx *ctx, enum setting_type type; value = settings_parse_get_value(set_parser, key, &type); - if (type == SET_STR) { + if (value != NULL && type == SET_STR) { const char *const *strp = value; line = t_strdup_printf("%s=%s%s",