From 951f903c66a5c2c12f43b816d8c08e179d2b3d4f Mon Sep 17 00:00:00 2001 From: rodrigc Date: Sat, 9 Dec 2006 16:34:37 +0000 Subject: In unionfs_readdir(), prevent a possible NULL dereference. CID: 1667 Found by: Coverity Prevent (tm) --- sys/fs/unionfs/union_vnops.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/fs') diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index 9452da5..c06b76d 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -1462,6 +1462,10 @@ unionfs_readdir(struct vop_readdir_args *ap) uio->uio_offset = 0; } + if (lvp == NULLVP) { + error = EBADF; + goto unionfs_readdir_exit; + } /* read lower */ error = VOP_READDIR(lvp, uio, ap->a_cred, ap->a_eofflag, ap->a_ncookies, ap->a_cookies); -- cgit v1.1