summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2001-06-03 18:40:23 +0000
committerderaadt <deraadt@openbsd.org>2001-06-03 18:40:23 +0000
commitd2d3f83a1397157c161a48b160e65e7da34ed172 (patch)
tree275a3343d6671fa137c2a43c766e26e593f8aa02 /sys
parentNope, that's not right either. Fix check for mutually exclusive args. (diff)
downloadwireguard-openbsd-d2d3f83a1397157c161a48b160e65e7da34ed172.tar.xz
wireguard-openbsd-d2d3f83a1397157c161a48b160e65e7da34ed172.zip
e_wmesg was not initialized in all cases; kirk.russell@acm.org
Diffstat (limited to 'sys')
-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);