Skip to content

Commit

Permalink
lib-storage: Fix potential crash when userdb-returns "key+=value" for…
Browse files Browse the repository at this point in the history
… a nonexistent setting.

type would have also happened to be initialized to SET_STR for the crash to
happen.
  • Loading branch information
sirainen authored and GitLab committed Sep 13, 2016
1 parent 9474b66 commit 79fff45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib-storage/mail-storage-service.c
Expand Up @@ -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",
Expand Down

0 comments on commit 79fff45

Please sign in to comment.