Skip to content

Commit

Permalink
config: Fix crash in doveconf -n when hiding sensitive information
Browse files Browse the repository at this point in the history
Broken by fc02343
  • Loading branch information
cmouse committed Aug 21, 2018
1 parent 6f56eb2 commit f0a6ae9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/config/doveconf.c
Expand Up @@ -209,8 +209,10 @@ hide_secrets_from_value(struct ostream *output, const char *key,
ptr++;
len = (size_t)(ptr-optr);
if (quote) {
o_stream_nsend_str(output,
str_nescape(optr, len));
string_t *quoted = t_str_new(len*2);
str_append_escaped(quoted, optr, len);
o_stream_nsend(output,
quoted->data, quoted->used);
} else {
o_stream_nsend(output, optr, len);
}
Expand All @@ -228,11 +230,11 @@ hide_secrets_from_value(struct ostream *output, const char *key,
Skip forward to avoid infinite loop. */
ptr++;
}
}
};
/* if we are dealing with output, send rest here */
if (ret) {
if (quote)
o_stream_nsend_str(output, str_escape(ptr));
o_stream_nsend_str(output, str_escape(optr));
else
o_stream_nsend_str(output, optr);
}
Expand Down

0 comments on commit f0a6ae9

Please sign in to comment.