summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-03-07 02:25:13 +0000
committerjhb <jhb@FreeBSD.org>2001-03-07 02:25:13 +0000
commitc7d1d654990520c728b49d9c95d05d3f5b807839 (patch)
tree943ee310de5a6980a5a2bc592e035b5adaf95fd2 /sys/kern/vfs_syscalls.c
parentfc1cdb0ea4595a57bb61542f9cd485e395f645d2 (diff)
downloadFreeBSD-src-c7d1d654990520c728b49d9c95d05d3f5b807839.zip
FreeBSD-src-c7d1d654990520c728b49d9c95d05d3f5b807839.tar.gz
Check to see if p_fd is NULL before derferencing it in checkdirs(). It's
possible for us to see a process in the early stages of fork before p_fd has been initialized. Ideally, we wouldn't stick a process on the allproc list until it was fully created however.
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-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 1670d4e..a6c9887 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -418,6 +418,8 @@ checkdirs(olddp, newdp)
ALLPROC_LOCK(AP_SHARED);
LIST_FOREACH(p, &allproc, p_list) {
fdp = p->p_fd;
+ if (fdp == NULL)
+ continue;
if (fdp->fd_cdir == olddp) {
vrele(fdp->fd_cdir);
VREF(newdp);
OpenPOWER on IntegriCloud