aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2002-01-17 15:46:11 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2002-01-17 15:46:11 +0000
commit2288c0a1751544a44d44ffb366146a6bb2672198 (patch)
tree945fb7fe9f8c5fff96af6dc9ce189569088c60e0
parent300d4a9e1c1b9e02712cc3d9004908b36c04df9d (diff)
downloadsrc-2288c0a1751544a44d44ffb366146a6bb2672198.tar.gz
src-2288c0a1751544a44d44ffb366146a6bb2672198.zip
MFC 1.216: Return EBADF if some vnode field has been reset to a NULL pointer.
Notes
Notes: svn path=/releng/4.4/; revision=89460
-rw-r--r--sys/kern/vfs_syscalls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index de2e4861e9ed..6bbd90fc8a63 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -678,6 +678,8 @@ fstatfs(p, uap)
if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
mp = ((struct vnode *)fp->f_data)->v_mount;
+ if (mp == NULL)
+ return (EBADF);
sp = &mp->mnt_stat;
error = VFS_STATFS(mp, sp, p);
if (error)