From 78f20f7b3e3c424319a02f12f8d5fc16c90d0932 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 27 Jun 2016 14:38:51 +0200 Subject: [PATCH] conf: fix parsing of refclock directive Don't accept refclock directive which has as the last argument an option that requires a value. --- conf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/conf.c b/conf.c index 94f4ee1..8470b7e 100644 --- a/conf.c +++ b/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; }