summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1996-10-04 23:43:12 +0000
committerjulian <julian@FreeBSD.org>1996-10-04 23:43:12 +0000
commit3259298288a43a63a0840204a55efcffcfe5be44 (patch)
treef33f3be621db05e8079a22fdc15935fd31ae32a8 /sys
parent8b748f91150d2c03c335842d8c4f043f382da515 (diff)
downloadFreeBSD-src-3259298288a43a63a0840204a55efcffcfe5be44.zip
FreeBSD-src-3259298288a43a63a0840204a55efcffcfe5be44.tar.gz
If we have no console device it is possible to be
1/ session leader 2/ Have a console device vnode (/dev/console) 3/ have NULL pointer for a consoel tty struct. fix the only case where the tty struct is referenced without a prior check for existance.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_exit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index eb9e444..531c0b2 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
- * $Id: kern_exit.c,v 1.38 1996/08/22 03:50:15 julian Exp $
+ * $Id: kern_exit.c,v 1.39 1996/09/13 09:17:03 bde Exp $
*/
#include "opt_ktrace.h"
@@ -196,7 +196,7 @@ exit1(p, rv)
* drain controlling terminal
* and revoke access to controlling terminal.
*/
- if (sp->s_ttyp->t_session == sp) {
+ if (sp->s_ttyp && (sp->s_ttyp->t_session == sp)) {
if (sp->s_ttyp->t_pgrp)
pgsignal(sp->s_ttyp->t_pgrp, SIGHUP, 1);
(void) ttywait(sp->s_ttyp);
OpenPOWER on IntegriCloud