summaryrefslogtreecommitdiff
path: root/sys/dev/vnd.c
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2004-06-30 00:13:54 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2004-06-30 00:13:54 +0000
commitbdb2e203d4da947f408796ccfc971971e4125f25 (patch)
treec80410a19ecb62adb8b20f5f8deaaebf35b9d45e /sys/dev/vnd.c
parentcfc237ccf740f0cb7da1707205d94984773ef55e (diff)
don't strlcpy() to user-space, use copyoutstr() instead. ok deraadt@
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r--sys/dev/vnd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 41beba95c16..730529363fe 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.50 2004/06/28 16:43:55 deraadt Exp $ */
+/* $OpenBSD: vnd.c,v 1.51 2004/06/30 00:13:53 pedro Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -922,8 +922,9 @@ vndioctl(dev, cmd, addr, flag, p)
if (error)
return (error);
- strlcpy(vnu->vnu_file, vnd->sc_file,
- sizeof(vnu->vnu_file));
+ if ((error = copyoutstr(vnd->sc_file, vnu->vnu_file,
+ sizeof(vnu->vnu_file), &len)))
+ return (error);
vnu->vnu_dev = vattr.va_fsid;
vnu->vnu_ino = vattr.va_fileid;