From: Timo Sirainen Date: Fri, 9 Sep 2016 14:55:20 +0000 (+0300) Subject: lib-storage: Fix potential crash when userdb-returns "key+=value" for a nonexistent... X-Git-Tag: 2.3.0.rc1~3037 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=79fff45046397ba48c8693d5f37a1fd93096987f;p=thirdparty%2Fdovecot%2Fcore.git 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. --- 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",