Skip to content

Commit

Permalink
NFSD: Use unsigned length argument for decode_filename
Browse files Browse the repository at this point in the history
Clean up: file 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>
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Feb 1, 2008
1 parent 48df020 commit ee1a95b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fs/nfsd/nfs3xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ encode_fh(__be32 *p, struct svc_fh *fhp)
* no slashes or null bytes.
*/
static __be32 *
decode_filename(__be32 *p, char **namp, int *lenp)
decode_filename(__be32 *p, char **namp, unsigned int *lenp)
{
char *name;
int i;
unsigned int i;

if ((p = xdr_decode_string_inplace(p, namp, lenp, NFS3_MAXNAMLEN)) != NULL) {
for (i = 0, name = *namp; i < *lenp; i++, name++) {
Expand Down
4 changes: 2 additions & 2 deletions fs/nfsd/nfsxdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ encode_fh(__be32 *p, struct svc_fh *fhp)
* no slashes or null bytes.
*/
static __be32 *
decode_filename(__be32 *p, char **namp, int *lenp)
decode_filename(__be32 *p, char **namp, unsigned int *lenp)
{
char *name;
int i;
unsigned int i;

if ((p = xdr_decode_string_inplace(p, namp, lenp, NFS_MAXNAMLEN)) != NULL) {
for (i = 0, name = *namp; i < *lenp; i++, name++) {
Expand Down

0 comments on commit ee1a95b

Please sign in to comment.