summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-06-03 18:40:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-06-03 18:40:24 +0000
commitd2beb6b9a2362848b27bc402f67747bef185580e (patch)
tree3a5ff0573e1f71cb91bd39730b4087896ae77b29
parent08b4098af974e519c85701607650fd14fbdf23ad (diff)
e_wmesg was not initialized in all cases; kirk.russell@acm.org
-rw-r--r--sys/kern/kern_sysctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 1ff25306a69..c795c862ee5 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.48 2001/06/03 04:41:33 angelos Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.49 2001/06/03 18:40:23 deraadt Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -951,8 +951,8 @@ fill_eproc(p, ep)
ep->e_flag = ep->e_sess->s_ttyvp ? EPROC_CTTY : 0;
if (SESS_LEADER(p))
ep->e_flag |= EPROC_SLEADER;
- if (p->p_wmesg)
- strncpy(ep->e_wmesg, p->p_wmesg, WMESGLEN);
+ strncpy(ep->e_wmesg, p->p_wmesg ? p->p_wmesg : "", WMESGLEN);
+ ep->e_wmesg[WMESGLEN] = '\0';
ep->e_xsize = ep->e_xrssize = 0;
ep->e_xccount = ep->e_xswrss = 0;
strncpy(ep->e_login, ep->e_sess->s_login, MAXLOGNAME-1);