1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00

conf-parser: refuse section headers with control characters early, just in case

This commit is contained in:
Lennart Poettering 2022-02-09 09:47:53 +01:00
parent 73a4ac8a75
commit cec7f09dc8

View File

@ -194,6 +194,9 @@ static int parse_line(
if (!n)
return log_oom();
if (!string_is_safe(n))
return log_syntax(unit, LOG_ERR, filename, line, SYNTHETIC_ERRNO(EBADMSG), "Bad characters in section header '%s'", l);
if (sections && !nulstr_contains(sections, n)) {
bool ignore;
const char *t;