diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-06-03 17:00:10 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-06-03 17:00:10 +0000 |
commit | b4c01e46d990ac226cb519e004e9766c8f9f845e (patch) | |
tree | d6e35db6687d93a5966095202f760e515c9887bd | |
parent | 9d478a6659b96a8538eced63153c2b979d72a29d (diff) |
zero sigaction before use
-rw-r--r-- | lib/libcurses/lib_tstp.c | 9 | ||||
-rw-r--r-- | usr.bin/make/job.c | 5 | ||||
-rw-r--r-- | usr.bin/make/util.c | 5 | ||||
-rw-r--r-- | usr.sbin/screenblank/screenblank.c | 3 |
4 files changed, 16 insertions, 6 deletions
diff --git a/lib/libcurses/lib_tstp.c b/lib/libcurses/lib_tstp.c index 651cb408c45..d53319ec72a 100644 --- a/lib/libcurses/lib_tstp.c +++ b/lib/libcurses/lib_tstp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tstp.c,v 1.6 1998/01/17 16:27:37 millert Exp $ */ +/* $OpenBSD: lib_tstp.c,v 1.7 1998/06/03 17:00:07 deraadt Exp $ */ /*************************************************************************** @@ -125,6 +125,7 @@ static void tstp(int dummy GCC_UNUSED) (void)sigprocmask(SIG_UNBLOCK, &mask, NULL); /* Now we want to resend SIGSTP to this process and suspend it */ + memset(&act, 0, sizeof act); act.sa_handler = SIG_DFL; sigemptyset(&act.sa_mask); act.sa_flags = 0; @@ -168,6 +169,8 @@ static void cleanup(int sig) || sig == SIGQUIT) { #if HAVE_SIGACTION || HAVE_SIGVEC sigaction_t act; + + memset(&act, 0, sizeof act); sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = SIG_IGN; @@ -258,6 +261,8 @@ void _nc_signal_handler(bool enable) static sigaction_t act, oact; static int ignore; + memset(&act, 0, sizeof act); + if (!ignore) { if (!enable) @@ -295,6 +300,8 @@ static int ignore; { #if HAVE_SIGACTION || HAVE_SIGVEC static sigaction_t act; + + memset(&act, 0, sizeof act); sigemptyset(&act.sa_mask); #if USE_SIGWINCH act.sa_handler = sigwinch; diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 3b250fdce4c..ecc0d3a53ef 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $OpenBSD: job.c,v 1.9 1998/03/15 22:19:24 flipk Exp $ */ +/* $OpenBSD: job.c,v 1.10 1998/06/03 17:00:05 deraadt Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: job.c,v 1.9 1998/03/15 22:19:24 flipk Exp $"; +static char rcsid[] = "$OpenBSD: job.c,v 1.10 1998/06/03 17:00:05 deraadt Exp $"; #endif #endif /* not lint */ @@ -412,6 +412,7 @@ JobPassSig(signo) sigemptyset(&nmask); sigaddset(&nmask, signo); sigprocmask(SIG_SETMASK, &nmask, &omask); + memset(&act, 0, sizeof act); act.sa_handler = SIG_DFL; sigemptyset(&act.sa_mask); act.sa_flags = 0; diff --git a/usr.bin/make/util.c b/usr.bin/make/util.c index 1d2c58fba97..4dd028b428c 100644 --- a/usr.bin/make/util.c +++ b/usr.bin/make/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.7 1997/07/25 21:05:36 mickey Exp $ */ +/* $OpenBSD: util.c,v 1.8 1998/06/03 17:00:04 deraadt Exp $ */ /* $NetBSD: util.c,v 1.10 1996/12/31 17:56:04 christos Exp $ */ /* @@ -6,7 +6,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: util.c,v 1.7 1997/07/25 21:05:36 mickey Exp $"; +static char rcsid[] = "$OpenBSD: util.c,v 1.8 1998/06/03 17:00:04 deraadt Exp $"; #endif #include <stdio.h> @@ -341,6 +341,7 @@ signal(s, a)) () { struct sigaction sa, osa; + memset(&sa, 0, sizeof sa); sa.sa_handler = a; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESTART; diff --git a/usr.sbin/screenblank/screenblank.c b/usr.sbin/screenblank/screenblank.c index b9f9cc91c9e..fdf633ce8bc 100644 --- a/usr.sbin/screenblank/screenblank.c +++ b/usr.sbin/screenblank/screenblank.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screenblank.c,v 1.4 1998/06/03 08:04:01 deraadt Exp $ */ +/* $OpenBSD: screenblank.c,v 1.5 1998/06/03 17:00:09 deraadt Exp $ */ /* $NetBSD: screenblank.c,v 1.2 1996/02/28 01:18:34 thorpej Exp $ */ /*- @@ -158,6 +158,7 @@ main(argc, argv) * Make sure the framebuffer gets turned back on when we're * killed. */ + memset(&sa, 0, sizeof sa); sa.sa_handler = sighandler; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_NOCLDSTOP; |