summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2012-03-26 04:19:55 +0000
committerderaadt <deraadt@openbsd.org>2012-03-26 04:19:55 +0000
commitae7eb20509475c2503cc42d73a6e60fb34764540 (patch)
tree796c504782c734aaba634825247ed146f10f9710
parentMention ZTE Skate. Other ZTE models might work but I have none to test. (diff)
downloadwireguard-openbsd-ae7eb20509475c2503cc42d73a6e60fb34764540.tar.xz
wireguard-openbsd-ae7eb20509475c2503cc42d73a6e60fb34764540.zip
clear junk in p_comm before copying shorter names into it
ok jsing guenther miod
-rw-r--r--sys/kern/kern_exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 2cf05248187..1940f070803 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.126 2012/03/23 15:51:26 guenther Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.127 2012/03/26 04:19:55 deraadt Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -472,9 +472,9 @@ sys_execve(struct proc *p, void *v, register_t *retval)
TCB_SET(p, NULL); /* reset the TCB address */
/* set command name & other accounting info */
+ bzero(p->p_comm, sizeof(p->p_comm));
len = min(nid.ni_cnd.cn_namelen, MAXCOMLEN);
bcopy(nid.ni_cnd.cn_nameptr, p->p_comm, len);
- p->p_comm[len] = 0;
p->p_acflag &= ~AFORK;
/* record proc's vnode, for use by procfs and others */