Linux NFS development
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: bfields@fieldses.org, nfs@lists.sourceforge.net,
	trond.myklebust@fys.uio.no
Subject: Re: [PATCH 1/8] SUNRPC: Use unsigned string lengths in	xdr_decode_string_inplace
Date: Fri, 2 Nov 2007 10:21:12 +1100	[thread overview]
Message-ID: <18218.24424.760975.221813@notabene.brown> (raw)
In-Reply-To: message from Chuck Lever on Thursday November 1


Thanks Chuck.
This series all:
   Acked-By: NeilBrown <neilb@suse.de>

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  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2007-11-01 23:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 20:56 [PATCH 1/8] SUNRPC: Use unsigned string lengths in xdr_decode_string_inplace Chuck Lever
2007-11-01 23:21 ` Neil Brown [this message]
2007-11-02 16:58   ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18218.24424.760975.221813@notabene.brown \
    --to=neilb@suse.de \
    --cc=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=nfs@lists.sourceforge.net \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox