diff options
author | 2016-01-25 12:44:16 +0000 | |
---|---|---|
committer | 2016-01-25 12:44:16 +0000 | |
commit | e1f89be445065f42e2cdd3a717be3e65f36acb87 (patch) | |
tree | 44d316284e0dc052ca5cd6e4aed9d71040053183 | |
parent | Remove decls #if'0ed since rev. 1.1 (diff) | |
download | wireguard-openbsd-e1f89be445065f42e2cdd3a717be3e65f36acb87.tar.xz wireguard-openbsd-e1f89be445065f42e2cdd3a717be3e65f36acb87.zip |
Zero when malloc'ing a buffer to be copyed out to userland to avoid
an information leak when not all of the buffer is written to.
ok mlarkin@
-rw-r--r-- | sys/arch/amd64/amd64/vmm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index 67056fe7b67..8e5fe5cff3f 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.31 2016/01/10 18:18:25 stefan Exp $ */ +/* $OpenBSD: vmm.c,v 1.32 2016/01/25 12:44:16 jsg Exp $ */ /* * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org> * @@ -2372,7 +2372,7 @@ vm_get_info(struct vm_info_params *vip) return (0); } - out = malloc(need, M_DEVBUF, M_NOWAIT); + out = malloc(need, M_DEVBUF, M_NOWAIT|M_ZERO); if (out == NULL) { vip->vip_info_ct = 0; rw_exit_read(&vmm_softc->vm_lock); |