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-Tag: v235~112^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6746%2Fhead;p=thirdparty%2Fsystemd.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 e08402e3d22..81c2cb14e76 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -725,6 +725,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; @@ -743,6 +748,7 @@ int config_parse_path( path_kill_slashes(n); +finalize: free(*s); *s = n;