diff options
| author | Bruce Evans <bde@FreeBSD.org> | 1998-06-14 12:53:39 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 1998-06-14 12:53:39 +0000 |
| commit | a395dbb15383b7eefff8cad896152743d0d9cead (patch) | |
| tree | 0c89200ce76bfa4a53f69d6f3af4f980cd9ac6c1 /sys/fs | |
| parent | ecf723aa39074632d74c8bbe1ba75a9ae38718c3 (diff) | |
Notes
Diffstat (limited to 'sys/fs')
| -rw-r--r-- | sys/fs/procfs/procfs_vnops.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index 74ef09d88574..1e4c388d9a23 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * - * $Id: procfs_vnops.c,v 1.57 1998/05/19 00:00:14 tegge Exp $ + * $Id: procfs_vnops.c,v 1.58 1998/06/10 06:34:57 peter Exp $ */ /* @@ -807,9 +807,7 @@ procfs_readdir(ap) struct pfsdent d; struct pfsdent *dp = &d; struct pfsnode *pfs; - int error; - int count; - int i; + int count, error, i, off; /* * We don't allow exporting procfs mounts, and currently local @@ -820,16 +818,14 @@ procfs_readdir(ap) pfs = VTOPFS(ap->a_vp); - if (uio->uio_resid < UIO_MX) - return (EINVAL); - if (uio->uio_offset & (UIO_MX-1)) - return (EINVAL); - if (uio->uio_offset < 0) + off = (int)uio->uio_offset; + if (off != uio->uio_offset || off < 0 || (u_int)off % UIO_MX != 0 || + uio->uio_resid < UIO_MX) return (EINVAL); error = 0; count = 0; - i = uio->uio_offset / UIO_MX; + i = (u_int)off / UIO_MX; switch (pfs->pfs_type) { /* |
