summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-03-28 03:39:22 +0000
committerderaadt <deraadt@openbsd.org>2013-03-28 03:39:22 +0000
commit5df403e18f1bf8532a8e86198ab2902d1a43fc6c (patch)
tree6b0388c48c6adf5fd8235d393aade360b855c6f0
parentit is no longer interesting that struct swapent is not compatible with a (diff)
downloadwireguard-openbsd-5df403e18f1bf8532a8e86198ab2902d1a43fc6c.tar.xz
wireguard-openbsd-5df403e18f1bf8532a8e86198ab2902d1a43fc6c.zip
do not copy additional kernel memory into the swapent.se_path[]
ok tedu
-rw-r--r--sys/uvm/uvm_swap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c
index 2cd7659de9c..3252c479a72 100644
--- a/sys/uvm/uvm_swap.c
+++ b/sys/uvm/uvm_swap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_swap.c,v 1.110 2012/09/20 20:20:11 miod Exp $ */
+/* $OpenBSD: uvm_swap.c,v 1.111 2013/03/28 03:39:22 deraadt Exp $ */
/* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */
/*
@@ -688,8 +688,9 @@ sys_swapctl(struct proc *p, void *v, register_t *retval)
/* now copy out the path if necessary */
if (error == 0)
- error = copyout(sdp->swd_path,
- &sep->se_path, sdp->swd_pathlen);
+ error = copyoutstr(sdp->swd_path,
+ sep->se_path, sizeof(sep->se_path),
+ NULL);
if (error)
goto out;