aboutsummaryrefslogtreecommitdiff
path: root/src/librc
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2019-02-23 17:25:16 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2019-02-23 17:44:07 -0600
commit028da5c2e37d81d4e242a546eb48a20eafe0cc56 (patch)
treeea8ca6f355d919cf1ad3aca10ae7a46d6de6504e /src/librc
parentd8dbb890aaca34fc9b342772de0f23a7ea3efaaa (diff)
librc: fix potential buffer overflow in pid_is_argv
This fixes #299.
Diffstat (limited to 'src/librc')
-rw-r--r--src/librc/librc-daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index 1bd91eb4..6c12669f 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -59,7 +59,7 @@ pid_is_argv(pid_t pid, const char *const *argv)
free(cmdline);
return false;
}
- bytes = read(fd, buffer, sizeof(buffer));
+ bytes = read(fd, buffer, sizeof(buffer) - 1);
close(fd);
free(cmdline);
if (bytes == -1)