diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-04-04 18:17:03 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-04-04 18:17:03 +0000 |
commit | 653f83720fd80b7b527283ca4a8aab51d7641d63 (patch) | |
tree | b28402402a9d66401d7f42db6b77d1d29d8d1091 | |
parent | 8d2e978f8b502d68f281ee7b221c0dd0f08da18f (diff) |
struct vfsconf is tightly packed, but let's M_ZERO it in case that ever
changes to avoid exposing userland memory.
-rw-r--r-- | sys/kern/vfs_subr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a8a53052f66..8cdeb565922 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.257 2017/01/15 23:18:05 bluhm Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.258 2017/04/04 18:17:02 deraadt Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -1311,7 +1311,7 @@ vfs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, return (EOPNOTSUPP); /* Make a copy, clear out kernel pointers */ - tmpvfsp = malloc(sizeof(*tmpvfsp), M_TEMP, M_WAITOK); + tmpvfsp = malloc(sizeof(*tmpvfsp), M_TEMP, M_WAITOK|M_ZERO); memcpy(tmpvfsp, vfsp, sizeof(*tmpvfsp)); tmpvfsp->vfc_vfsops = NULL; tmpvfsp->vfc_next = NULL; |