summaryrefslogtreecommitdiffstats
path: root/src/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/api.c')
-rw-r--r--src/api.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/api.c b/src/api.c
index 4f88d20..43f08d0 100644
--- a/src/api.c
+++ b/src/api.c
@@ -476,8 +476,9 @@ static int cgroup_parse_rules(bool cache, uid_t muid, gid_t mgid)
newrule->uid = uid;
newrule->gid = gid;
- strncpy(newrule->name, user, strlen(user));
- strncpy(newrule->destination, destination, strlen(destination));
+ strncpy(newrule->name, user, sizeof(newrule->name) - 1);
+ strncpy(newrule->destination, destination,
+ sizeof(newrule->destination) - 1);
newrule->next = NULL;
/* Parse the controller list, and add that to newrule too. */