Commit 9c7544d3 authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields

NFSD: Use unsigned length argument for decode_pathname

Clean up: path name lengths are unsigned on the wire, negative lengths
are not meaningful natively either.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Acked-By: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 5a022fc8
...@@ -78,10 +78,10 @@ decode_filename(__be32 *p, char **namp, unsigned int *lenp) ...@@ -78,10 +78,10 @@ decode_filename(__be32 *p, char **namp, unsigned int *lenp)
} }
static __be32 * static __be32 *
decode_pathname(__be32 *p, char **namp, int *lenp) decode_pathname(__be32 *p, char **namp, unsigned int *lenp)
{ {
char *name; char *name;
int i; unsigned int i;
if ((p = xdr_decode_string_inplace(p, namp, lenp, NFS_MAXPATHLEN)) != NULL) { if ((p = xdr_decode_string_inplace(p, namp, lenp, NFS_MAXPATHLEN)) != NULL) {
for (i = 0, name = *namp; i < *lenp; i++, name++) { for (i = 0, name = *namp; i < *lenp; i++, name++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment