summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2002-11-22 23:27:45 +0000
committermillert <millert@openbsd.org>2002-11-22 23:27:45 +0000
commitd4e4490525c79a3d8208b7af1dc2889e5300c9a0 (patch)
tree4cba1708f98c89a905659b705de79189b8aded3d /lib/libc
parentnew sysctl: machdep.v8mul says whether the kernel replaced the mul/div/rem (diff)
downloadwireguard-openbsd-d4e4490525c79a3d8208b7af1dc2889e5300c9a0.tar.xz
wireguard-openbsd-d4e4490525c79a3d8208b7af1dc2889e5300c9a0.zip
Initialize status to zero before calling waitpid(). That way, if
there is nothing to be waited for (for instance if SIGCHLD is being ignored) we don't check WIFEXITED(garbage off the stack).
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/auth_subr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c
index 73a080a960f..0e28516ceb6 100644
--- a/lib/libc/gen/auth_subr.c
+++ b/lib/libc/gen/auth_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth_subr.c,v 1.20 2002/11/22 19:47:03 deraadt Exp $ */
+/* $OpenBSD: auth_subr.c,v 1.21 2002/11/22 23:27:45 millert Exp $ */
/*-
* Copyright (c) 1995,1996,1997 Berkeley Software Design, Inc.
@@ -848,6 +848,7 @@ auth_call(auth_session_t *as, char *path, ...)
as->index = 0;
_auth_spool(as, pfd[0]);
close(pfd[0]);
+ status = 0;
if (waitpid(pid, &status, 0) < 0) {
if (errno != ECHILD) {
syslog(LOG_ERR, "%s: waitpid: %m", path);