diff options
Diffstat (limited to 'sys/isofs/udf/udf_vfsops.c')
-rw-r--r-- | sys/isofs/udf/udf_vfsops.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/isofs/udf/udf_vfsops.c b/sys/isofs/udf/udf_vfsops.c index 5e13fb6a772..cb3fbe46e69 100644 --- a/sys/isofs/udf/udf_vfsops.c +++ b/sys/isofs/udf/udf_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udf_vfsops.c,v 1.38 2011/07/04 20:35:35 deraadt Exp $ */ +/* $OpenBSD: udf_vfsops.c,v 1.39 2012/09/10 11:10:59 jsing Exp $ */ /* * Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org> @@ -122,7 +122,7 @@ udf_mount(struct mount *mp, const char *path, void *data, { struct vnode *devvp; /* vnode of the mount device */ struct udf_args args; - size_t len; + char fspec[MNAMELEN]; int error; if ((mp->mnt_flag & MNT_RDONLY) == 0) { @@ -146,7 +146,11 @@ udf_mount(struct mount *mp, const char *path, void *data, if (args.fspec == NULL) return (EINVAL); - NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, p); + error = copyinstr(args.fspec, fspec, sizeof(fspec), NULL); + if (error) + return (error); + + NDINIT(ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, fspec, p); if ((error = namei(ndp))) return (error); @@ -180,10 +184,10 @@ udf_mount(struct mount *mp, const char *path, void *data, /* * Keep a copy of the mount information. */ - copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &len); - bzero(mp->mnt_stat.f_mntonname + len, MNAMELEN - len); - copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &len); - bzero(mp->mnt_stat.f_mntfromname + len, MNAMELEN - len); + bzero(mp->mnt_stat.f_mntonname, MNAMELEN); + strlcpy(mp->mnt_stat.f_mntonname, path, MNAMELEN); + bzero(mp->mnt_stat.f_mntfromname, MNAMELEN); + strlcpy(mp->mnt_stat.f_mntfromname, fspec, MNAMELEN); return (0); }; |