aboutsummaryrefslogtreecommitdiff
path: root/src/librc
diff options
context:
space:
mode:
Diffstat (limited to 'src/librc')
-rw-r--r--src/librc/librc-daemon.c4
-rw-r--r--src/librc/librc.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 2b0d9712..5a76c880 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -147,7 +147,7 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid)
memset(my_ns, 0, sizeof(my_ns));
memset(proc_ns, 0, sizeof(proc_ns));
if (exists("/proc/self/ns/pid")) {
- rc = readlink("/proc/self/ns/pid", my_ns, sizeof(my_ns));
+ rc = readlink("/proc/self/ns/pid", my_ns, sizeof(my_ns)-1);
if (rc <= 0)
my_ns[0] = '\0';
}
@@ -161,7 +161,7 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid)
continue;
xasprintf(&buffer, "/proc/%d/ns/pid", p);
if (exists(buffer)) {
- rc = readlink(buffer, proc_ns, sizeof(proc_ns));
+ rc = readlink(buffer, proc_ns, sizeof(proc_ns)-1);
if (rc <= 0)
proc_ns[0] = '\0';
}
diff --git a/src/librc/librc.c b/src/librc/librc.c
index c38695cc..1bdd9307 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -558,7 +558,7 @@ rc_service_resolve(const char *service)
if (*file) {
memset(buffer, 0, sizeof(buffer));
- r = readlink(file, buffer, sizeof(buffer));
+ r = readlink(file, buffer, sizeof(buffer)-1);
if (r > 0)
return xstrdup(buffer);
}