summaryrefslogtreecommitdiff
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2002-04-21 16:14:54 +0000
committerIan Dowse <iedowse@FreeBSD.org>2002-04-21 16:14:54 +0000
commit3aed248695acd0fdbadf4da6f183d0eca45f6faa (patch)
tree01bda32e906388ba9222d35f6cc558e0096891c1 /sys/nfsserver
parent73f2cd104cb39fdbb4df5eb71054b33f8902dc54 (diff)
Notes
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_serv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 21c225ba276f..05272f26d798 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -3012,6 +3012,8 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
cnt = fxdr_unsigned(int, *tl);
siz = ((cnt + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1));
xfer = NFS_SRVMAXDATA(nfsd);
+ if (cnt > xfer)
+ cnt = xfer;
if (siz > xfer)
siz = xfer;
fullsiz = siz;
@@ -3300,6 +3302,8 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
off = toff;
siz = ((siz + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1));
xfer = NFS_SRVMAXDATA(nfsd);
+ if (cnt > xfer)
+ cnt = xfer;
if (siz > xfer)
siz = xfer;
fullsiz = siz;