summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2017-05-07 15:19:33 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2017-05-07 15:19:33 +0000
commit03e014232b141d938451aca6862f5d43f0594524 (patch)
treea4ea8c93328583e1b649c53e2d42edcf2bb0929c /lib/libc
parentc7206c2dd294e57a7914f0d667cbf629bcf6152e (diff)
Don't allow a negative process group ID, it would turn into a
process ID when negated.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/compat-43/killpg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/compat-43/killpg.c b/lib/libc/compat-43/killpg.c
index 75b1ad98a8d..3506b8e2b44 100644
--- a/lib/libc/compat-43/killpg.c
+++ b/lib/libc/compat-43/killpg.c
@@ -37,7 +37,7 @@
int
killpg(pid_t pgid, int sig)
{
- if (pgid == 1) {
+ if (pgid < 0 || pgid == 1) {
errno = ESRCH;
return (-1);
}