]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: allow to input empty string to config_parse_path() 6746/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 5 Sep 2017 06:12:55 +0000 (15:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 5 Sep 2017 06:13:05 +0000 (15:13 +0900)
Fixes #6633.

src/shared/conf-parser.c

index e08402e3d22ea54e785c8d4bac71f490d9e8a797..81c2cb14e76717f6eda8013e473708023589bbc2 100644 (file)
@@ -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;