summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-04-20 13:24:31 +1000
committerDamien Miller <djm@mindrot.org>2014-04-20 13:24:31 +1000
commit75c62728dc87af6805696eeb520b9748faa136c8 (patch)
treea9cbb437cd8cabb21e3931fd1baca62da6453d9f /sshd.c
parent2a328437fb1b0976f2f4522d8645803d5a5d0967 (diff)
- djm@cvs.openbsd.org 2014/04/12 04:55:53
[sshd.c] avoid crash at exit: check that pmonitor!=NULL before dereferencing; bz#2225, patch from kavi AT juniper.net
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sshd.c b/sshd.c
index 0ade55771..f0fc07896 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.421 2014/03/26 19:58:37 tedu Exp $ */ 1/* $OpenBSD: sshd.c,v 1.423 2014/04/12 04:55:53 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2484,7 +2484,8 @@ cleanup_exit(int i)
2484{ 2484{
2485 if (the_authctxt) { 2485 if (the_authctxt) {
2486 do_cleanup(the_authctxt); 2486 do_cleanup(the_authctxt);
2487 if (use_privsep && privsep_is_preauth && pmonitor->m_pid > 1) { 2487 if (use_privsep && privsep_is_preauth &&
2488 pmonitor != NULL && pmonitor->m_pid > 1) {
2488 debug("Killing privsep child %d", pmonitor->m_pid); 2489 debug("Killing privsep child %d", pmonitor->m_pid);
2489 if (kill(pmonitor->m_pid, SIGKILL) != 0 && 2490 if (kill(pmonitor->m_pid, SIGKILL) != 0 &&
2490 errno != ESRCH) 2491 errno != ESRCH)