]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Fix string termination in refclock parameter parser
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 9 Sep 2009 15:12:43 +0000 (17:12 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 9 Sep 2009 15:12:43 +0000 (17:12 +0200)
conf.c

diff --git a/conf.c b/conf.c
index b5ef510fb22be61bfd3cfec6bbedd462718b6f55..9bad6a174c9229d8c8d9184735a9e83ddf048421 100644 (file)
--- 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;