From: Miroslav Lichvar Date: Wed, 9 Sep 2009 15:12:43 +0000 (+0200) Subject: Fix string termination in refclock parameter parser X-Git-Tag: 1.24-pre1~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19f3a6bca85d5afe026eca73e95519e55ea76c6b;p=thirdparty%2Fchrony.git Fix string termination in refclock parameter parser --- diff --git a/conf.c b/conf.c index b5ef510f..9bad6a17 100644 --- a/conf.c +++ b/conf.c @@ -464,7 +464,7 @@ parse_refclock(const char *line) param = MallocArray(char, 1 + line - tmp); strncpy(param, tmp, line - tmp); - param[line - tmp + 1] = '\0'; + param[line - tmp] = '\0'; while (sscanf(line, "%10s%n", cmd, &n) == 1) { line += n;