summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2014-04-12 04:55:53 +0000
committerdjm <djm@openbsd.org>2014-04-12 04:55:53 +0000
commit9aa70aad347a9a76e165044992eb6434ff1b3d9d (patch)
tree0d66875b9eaba84ae36420b583e3c57edbd17a9e
parentregen (diff)
downloadwireguard-openbsd-9aa70aad347a9a76e165044992eb6434ff1b3d9d.tar.xz
wireguard-openbsd-9aa70aad347a9a76e165044992eb6434ff1b3d9d.zip
avoid crash at exit: check that pmonitor!=NULL before dereferencing;
bz#2225, patch from kavi AT juniper.net
-rw-r--r--usr.bin/ssh/sshd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index 9efd1b142c3..e15dedd421a 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.422 2014/03/27 23:01:27 markus Exp $ */
+/* $OpenBSD: sshd.c,v 1.423 2014/04/12 04:55:53 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2338,7 +2338,8 @@ cleanup_exit(int i)
{
if (the_authctxt) {
do_cleanup(the_authctxt);
- if (use_privsep && privsep_is_preauth && pmonitor->m_pid > 1) {
+ if (use_privsep && privsep_is_preauth &&
+ pmonitor != NULL && pmonitor->m_pid > 1) {
debug("Killing privsep child %d", pmonitor->m_pid);
if (kill(pmonitor->m_pid, SIGKILL) != 0 &&
errno != ESRCH)