]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootspec: complain about loader.conf lines without parameter
authorLennart Poettering <lennart@poettering.net>
Fri, 2 Sep 2022 09:33:48 +0000 (11:33 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 2 Sep 2022 14:22:46 +0000 (16:22 +0200)
src/shared/bootspec.c

index ebb172404b358048e1fa36c3fdc04081516e48ca..3ca65454c1ac8a1c7a28436f770bc79fed864370 100644 (file)
@@ -369,6 +369,10 @@ int boot_loader_read_conf(BootConfig *config, FILE *file, const char *path) {
                         log_syntax(NULL, LOG_WARNING, path, line, 0, "Bad syntax, ignoring line.");
                         continue;
                 }
+                if (isempty(p)) {
+                        log_syntax(NULL, LOG_WARNING, path, line, 0, "Field '%s' without value, ignoring line.", field);
+                        continue;
+                }
 
                 if (streq(field, "default"))
                         r = free_and_strdup(&config->default_pattern, p);