compat_30_sys_getfh: check the size of filehandle. remove an unnecessary cast.
This commit is contained in:
parent
273fdcedb9
commit
a4aecea36e
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_syscalls_30.c,v 1.14 2006/08/04 16:29:51 yamt Exp $ */
|
||||
/* $NetBSD: vfs_syscalls_30.c,v 1.15 2006/08/04 16:58:27 yamt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 The NetBSD Foundation, Inc.
|
||||
@ -36,7 +36,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.14 2006/08/04 16:29:51 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.15 2006/08/04 16:58:27 yamt Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -383,10 +383,12 @@ compat_30_sys_getfh(struct lwp *l, void *v, register_t *retval)
|
||||
sz = sizeof(struct compat_30_fhandle);
|
||||
error = vfs_composefh(vp, (void *)&fh, &sz);
|
||||
vput(vp);
|
||||
if (sz != FHANDLE_SIZE_COMPAT) {
|
||||
error = EINVAL;
|
||||
}
|
||||
if (error)
|
||||
return (error);
|
||||
error = copyout(&fh, (caddr_t)SCARG(uap, fhp),
|
||||
sizeof(struct compat_30_fhandle));
|
||||
error = copyout(&fh, SCARG(uap, fhp), sizeof(struct compat_30_fhandle));
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user