From 9ac2a89a8f02df9ea26df56891973172cf712d65 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 2 Sep 2022 11:33:48 +0200 Subject: [PATCH] bootspec: complain about loader.conf lines without parameter --- src/shared/bootspec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index ebb172404b3..3ca65454c1a 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -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); -- 2.47.3