2007-11-01 23:21:17

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH 1/8] SUNRPC: Use unsigned string lengths in xdr_decode_string_inplace


Thanks Chuck.
This series all:
Acked-By: NeilBrown <[email protected]>

Just one question:

> diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
> index fdc5e6d..31bd346 100644
> --- a/net/sunrpc/xdr.c
> +++ b/net/sunrpc/xdr.c
> @@ -93,11 +93,13 @@ xdr_encode_string(__be32 *p, const char *string)
> }
>
> __be32 *
> -xdr_decode_string_inplace(__be32 *p, char **sp, int *lenp, int maxlen)
> +xdr_decode_string_inplace(__be32 *p, char **sp,
> + unsigned int *lenp, unsigned int maxlen)
> {
> - unsigned int len;
> + u32 len;

What is the reason for making this a u32? You seem to be happy with
"unsigned int" everywhere else.

It's not important, but I'm curious.

NeilBrown

>
> - if ((len = ntohl(*p++)) > maxlen)
> + len = ntohl(*p++);
> + if (len > maxlen)
> return NULL;
> *lenp = len;
> *sp = (char *) p;

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs