提交 ee1a95b3 编写于 作者: C Chuck Lever 提交者: J. Bruce Fields

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: NChuck Lever <chuck.lever@oracle.com>
Acked-By: NNeilBrown <neilb@suse.de>
Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
上级 48df020a
......@@ -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++) {
......
......@@ -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++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册