]> err.no Git - linux-2.6/commitdiff
NFSD: Use unsigned length argument for decode_pathname
authorChuck Lever <chuck.lever@oracle.com>
Thu, 1 Nov 2007 20:57:14 +0000 (16:57 -0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Fri, 1 Feb 2008 21:42:03 +0000 (16:42 -0500)
Clean up: path name lengths are unsigned on the wire, negative lengths
are not meaningful natively either.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Acked-By: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfsxdr.c

index 50bd6187edfc289155fc0fae2af8cc1a6b7072c0..7003c313272f85cdc16f0ba2785725ccf5a1cc21 100644 (file)
@@ -78,10 +78,10 @@ decode_filename(__be32 *p, char **namp, unsigned int *lenp)
 }
 
 static __be32 *
-decode_pathname(__be32 *p, char **namp, int *lenp)
+decode_pathname(__be32 *p, char **namp, unsigned int *lenp)
 {
        char            *name;
-       int             i;
+       unsigned int    i;
 
        if ((p = xdr_decode_string_inplace(p, namp, lenp, NFS_MAXPATHLEN)) != NULL) {
                for (i = 0, name = *namp; i < *lenp; i++, name++) {