You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
NFSD: Use unsigned length argument for decode_filename
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>
This commit is contained in:
committed by
J. Bruce Fields
parent
48df020aa1
commit
ee1a95b3b3
+2
-2
@@ -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++) {
|
||||
|
||||
+2
-2
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user