diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-04-29 07:36:33 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-04-29 07:36:33 +0000 |
commit | 2d19f2c3a8296308174ecb5883c8463dc5c32a95 (patch) | |
tree | f9855a25103cfc556731545c667845ebeade26d9 /sys | |
parent | 58b795ff3804354615895262e28a384888974748 (diff) |
constrain readdirplus request count; j@pureftpd.org, ok costa
Diffstat (limited to 'sys')
-rw-r--r-- | sys/nfs/nfs_serv.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 704165b2fa1..7c0769f4d4b 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_serv.c,v 1.30 2002/01/16 21:51:16 ericj Exp $ */ +/* $OpenBSD: nfs_serv.c,v 1.31 2002/04/29 07:36:32 deraadt Exp $ */ /* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */ /* @@ -2404,6 +2404,8 @@ nfsrv_readdir(nfsd, slp, procp, mrq) xfer = NFS_SRVMAXDATA(nfsd); if (siz > xfer) siz = xfer; + if (cnt > xfer) + cnt = xfer; fullsiz = siz; error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly, (nfsd->nd_flag & ND_KERBAUTH)); @@ -2662,6 +2664,8 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq) xfer = NFS_SRVMAXDATA(nfsd); if (siz > xfer) siz = xfer; + if (cnt > xfer) + cnt = xfer; fullsiz = siz; error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly, (nfsd->nd_flag & ND_KERBAUTH)); |