[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6912124.fRD6ipzQbq@machine>
Date: Tue, 20 Oct 2020 12:28:49 +0200
From: Francis Laniel <laniel_francis@...vacyrequired.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Kees Cook <keescook@...omium.org>, linux-hardening@...r.kernel.org,
davem@...emloft.net
Subject: Re: [RFC][PATCH v2 2/3] Modify return value of nla_strlcpy to match that of strscpy.
Le mardi 20 octobre 2020, 01:34:49 CEST Jakub Kicinski a écrit :
> On Mon, 19 Oct 2020 16:01:27 -0700 Kees Cook wrote:
> > On Mon, Oct 19, 2020 at 09:43:55AM -0700, Jakub Kicinski wrote:
> > > On Mon, 19 Oct 2020 17:23:30 +0200 laniel_francis@...vacyrequired.com
> > >
> > > wrote:
> > > > -size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t
> > > > dstsize)
> > > > +ssize_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t
> > > > dstsize)
> > > >
> > > > {
> > > >
> > > > + size_t len;
> > > > + ssize_t ret;
> > > >
> > > > size_t srclen = nla_len(nla);
> > > > char *src = nla_data(nla);
> > >
> > > Sort local variables long to short.
> >
> > Specifically, "reverse christmas tree":
> > size_t srclen = nla_len(nla);
> > char *src = nla_data(nla);
> > size_t len;
> > ssize_t ret;
>
> Or even
>
> size_t srclen = nla_len(nla);
> char *src = nla_data(nla);
> ssize_t ret;
> size_t len;
>
> ;)
I reordered the variables names for the v3.
Just to know, is it a new rule? Because scripts/checkpatch.pl did not report
anything and I was not aware of it.
Powered by blists - more mailing lists