diff options
author | 2012-03-26 04:19:55 +0000 | |
---|---|---|
committer | 2012-03-26 04:19:55 +0000 | |
commit | ae7eb20509475c2503cc42d73a6e60fb34764540 (patch) | |
tree | 796c504782c734aaba634825247ed146f10f9710 | |
parent | Mention ZTE Skate. Other ZTE models might work but I have none to test. (diff) | |
download | wireguard-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.c | 4 |
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 */ |