summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-11-22 23:27:46 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-11-22 23:27:46 +0000
commit638c65fd9b16660ad92953e9e0f99338b8b27eba (patch)
tree3db4db9d03092cfbb1aada7a97438f463cd1cd29 /lib
parent93c78fad24fed6979660dabfd3a34607f8dd8032 (diff)
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')
-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);