diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2006-12-09 16:34:37 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2006-12-09 16:34:37 +0000 |
commit | 951f903c66a5c2c12f43b816d8c08e179d2b3d4f (patch) | |
tree | f732cc422129443d4bbacde1769ff593d2718003 /sys | |
parent | e9a21b7fd84c778db132c4e05e9f424795c38106 (diff) | |
download | FreeBSD-src-951f903c66a5c2c12f43b816d8c08e179d2b3d4f.zip FreeBSD-src-951f903c66a5c2c12f43b816d8c08e179d2b3d4f.tar.gz |
In unionfs_readdir(), prevent a possible NULL dereference.
CID: 1667
Found by: Coverity Prevent (tm)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/fs/unionfs/union_vnops.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |