mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 11:15:07 -05:00
Fix string termination in refclock parameter parser
This commit is contained in:
2
conf.c
2
conf.c
@@ -464,7 +464,7 @@ parse_refclock(const char *line)
|
|||||||
|
|
||||||
param = MallocArray(char, 1 + line - tmp);
|
param = MallocArray(char, 1 + line - tmp);
|
||||||
strncpy(param, tmp, line - tmp);
|
strncpy(param, tmp, line - tmp);
|
||||||
param[line - tmp + 1] = '\0';
|
param[line - tmp] = '\0';
|
||||||
|
|
||||||
while (sscanf(line, "%10s%n", cmd, &n) == 1) {
|
while (sscanf(line, "%10s%n", cmd, &n) == 1) {
|
||||||
line += n;
|
line += n;
|
||||||
|
|||||||
Reference in New Issue
Block a user