mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:45:07 -05:00
conf: fix parsing of refclock directive
Don't accept refclock directive which has as the last argument an option that requires a value.
This commit is contained in:
7
conf.c
7
conf.c
@@ -696,9 +696,9 @@ parse_refclock(char *line)
|
||||
line = CPS_SplitWord(line);
|
||||
param = Strdup(p);
|
||||
|
||||
while (*line) {
|
||||
cmd = line;
|
||||
for (cmd = line; *cmd; line += n, cmd = line) {
|
||||
line = CPS_SplitWord(line);
|
||||
|
||||
if (!strcasecmp(cmd, "refid")) {
|
||||
if (sscanf(line, "%4s%n", (char *)ref, &n) != 1)
|
||||
break;
|
||||
@@ -756,10 +756,9 @@ parse_refclock(char *line)
|
||||
other_parse_error("Invalid refclock option");
|
||||
return;
|
||||
}
|
||||
line += n;
|
||||
}
|
||||
|
||||
if (*line) {
|
||||
if (*cmd) {
|
||||
command_parse_error();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user