]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fix potential crash when userdb-returns "key+=value" for a nonexistent...
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 9 Sep 2016 14:55:20 +0000 (17:55 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 13 Sep 2016 14:51:25 +0000 (17:51 +0300)
type would have also happened to be initialized to SET_STR for the crash to
happen.

src/lib-storage/mail-storage-service.c

index 3d21a112b89897fdc91698b85b263d6e62ac1908..14f6380ed401bdabc848d550e286ec199c425384 100644 (file)
@@ -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",