diff options
Diffstat (limited to 'sys/fs/nfsclient/nfs_clrpcops.c')
| -rw-r--r-- | sys/fs/nfsclient/nfs_clrpcops.c | 12 | 
1 files changed, 8 insertions, 4 deletions
| diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 983eb8b9226f..b61218958550 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -5284,7 +5284,7 @@ nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpath, struct ucred *cred,  	struct nfsrv_descript nfsd;  	struct nfsrv_descript *nd = &nfsd;  	u_char *cp, *cp2, *fhp; -	int error, cnt, len, setnil; +	int error, cnt, i, len, setnil;  	u_int32_t *opcntp;  	nfscl_reqstart(nd, NFSPROC_PUTROOTFH, nmp, NULL, 0, &opcntp, NULL, 0, @@ -5325,8 +5325,12 @@ nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpath, struct ucred *cred,  	if (error)  		return (error);  	if (nd->nd_repstat == 0) { -		NFSM_DISSECT(tl, u_int32_t *, (3 + 2 * cnt) * NFSX_UNSIGNED); -		tl += (2 + 2 * cnt); +		NFSM_DISSECT(tl, uint32_t *, 3 * NFSX_UNSIGNED); +		tl += 2; +		for (i = 0; i < cnt; i++) { +			NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); +			tl++; +		}  		if ((len = fxdr_unsigned(int, *tl)) <= 0 ||  			len > NFSX_FHMAX) {  			nd->nd_repstat = NFSERR_BADXDR; @@ -9756,7 +9760,7 @@ nfsm_split(struct mbuf *mp, uint64_t xfer)  		pgno++;  	} while (pgno < m->m_epg_npgs);  	if (pgno == m->m_epg_npgs) -		panic("nfsm_split: eroneous ext_pgs mbuf"); +		panic("nfsm_split: erroneous ext_pgs mbuf");  	m2 = mb_alloc_ext_pgs(M_WAITOK, mb_free_mext_pgs, 0);  	m2->m_epg_flags |= EPG_FLAG_ANON; | 
