summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index 3a31d5c18..554ceb0b1 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.146 2020/01/28 01:49:36 djm Exp $ */ 1/* $OpenBSD: misc.c,v 1.147 2020/04/25 06:59:36 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved. 4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -2255,11 +2255,13 @@ ssh_signal(int signum, sshsig_t handler)
2255 struct sigaction sa, osa; 2255 struct sigaction sa, osa;
2256 2256
2257 /* mask all other signals while in handler */ 2257 /* mask all other signals while in handler */
2258 bzero(&sa, sizeof(sa)); 2258 memset(&sa, 0, sizeof(sa));
2259 sa.sa_handler = handler; 2259 sa.sa_handler = handler;
2260 sigfillset(&sa.sa_mask); 2260 sigfillset(&sa.sa_mask);
2261#if defined(SA_RESTART) && !defined(NO_SA_RESTART)
2261 if (signum != SIGALRM) 2262 if (signum != SIGALRM)
2262 sa.sa_flags = SA_RESTART; 2263 sa.sa_flags = SA_RESTART;
2264#endif
2263 if (sigaction(signum, &sa, &osa) == -1) { 2265 if (sigaction(signum, &sa, &osa) == -1) {
2264 debug3("sigaction(%s): %s", strsignal(signum), strerror(errno)); 2266 debug3("sigaction(%s): %s", strsignal(signum), strerror(errno));
2265 return SIG_ERR; 2267 return SIG_ERR;