summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshbuf.c
diff options
context:
space:
mode:
authordtucker <dtucker@openbsd.org>2020-01-23 07:10:22 +0000
committerdtucker <dtucker@openbsd.org>2020-01-23 07:10:22 +0000
commite9716d4d0197fd363c1f073b60440e4d04eab018 (patch)
treeb7aa5b64dce2d2a8bd737ed9add30d2d528f9563 /usr.bin/ssh/sshbuf.c
parentAdd code to build and send a server hello for tls 1.3 (diff)
downloadwireguard-openbsd-e9716d4d0197fd363c1f073b60440e4d04eab018.tar.xz
wireguard-openbsd-e9716d4d0197fd363c1f073b60440e4d04eab018.zip
Replace all calls to signal(2) with a wrapper around sigaction(2).
This wrapper blocks all other signals during the handler preventing races between handlers, and sets SA_RESTART which should reduce the potential for short read/write operations.
Diffstat (limited to 'usr.bin/ssh/sshbuf.c')
-rw-r--r--usr.bin/ssh/sshbuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshbuf.c b/usr.bin/ssh/sshbuf.c
index f071c1848af..1eaaf77854f 100644
--- a/usr.bin/ssh/sshbuf.c
+++ b/usr.bin/ssh/sshbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshbuf.c,v 1.13 2018/11/16 06:10:29 djm Exp $ */
+/* $OpenBSD: sshbuf.c,v 1.14 2020/01/23 07:10:22 dtucker Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
@@ -40,7 +40,7 @@ sshbuf_check_sanity(const struct sshbuf *buf)
buf->off > buf->size)) {
/* Do not try to recover from corrupted buffer internals */
SSHBUF_DBG(("SSH_ERR_INTERNAL_ERROR"));
- signal(SIGSEGV, SIG_DFL);
+ ssh_signal(SIGSEGV, SIG_DFL);
raise(SIGSEGV);
return SSH_ERR_INTERNAL_ERROR;
}