diff --git a/src/common/dim_baseline.c b/src/common/dim_baseline.c index 6369d7b10c2d8068abdbb9fc193d845eaa03afb3..4733705bc9abd89fbccee67b3004badf5fb06986 100644 --- a/src/common/dim_baseline.c +++ b/src/common/dim_baseline.c @@ -104,7 +104,8 @@ int dim_baseline_add(struct dim_baseline_tree *root, const char *name, if (ret < 0) goto err; - strcpy((char *)baseline->name, name); + strncpy((char *)baseline->name, name, buf_len - 1); + baseline->name[buf_len - 1] = '\0'; write_lock(&root->lock); ret = dim_baseline_rb_add(&root->rb_root, baseline, NULL);