From 028da5c2e37d81d4e242a546eb48a20eafe0cc56 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Sat, 23 Feb 2019 17:25:16 -0600 Subject: librc: fix potential buffer overflow in pid_is_argv This fixes #299. --- src/librc/librc-daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/librc') 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) -- cgit v1.2.3