From: Yu Watanabe Date: Tue, 5 Sep 2017 06:12:55 +0000 (+0900) Subject: shared: allow to input empty string to config_parse_path() X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e0ff144df1d7205311cb8174e948e56aae102fb6;p=elogind.git shared: allow to input empty string to config_parse_path() Fixes #6633. --- diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 7b3ac8999..c8a95c7f3 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -734,6 +734,11 @@ int config_parse_path( assert(rvalue); assert(data); + if (isempty(rvalue)) { + n = NULL; + goto finalize; + } + if (!utf8_is_valid(rvalue)) { log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, rvalue); return fatal ? -ENOEXEC : 0; @@ -752,6 +757,7 @@ int config_parse_path( path_kill_slashes(n); +finalize: free(*s); *s = n;