Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2019 03:21:11 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        araujo@freebsd.org
Cc:        Warner Losh <imp@bsdimp.com>, src-committers <src-committers@freebsd.org>,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r343634 - head/usr.sbin/bhyve
Message-ID:  <20190201012111.GB24863@kib.kiev.ua>
In-Reply-To: <CAOfEmZgrt1EzddzooFmdZgV1xyVqwVD1ngNK%2B%2BahwNfRiOV_sw@mail.gmail.com>
References:  <201901312332.x0VNWJ6o016057@repo.freebsd.org> <20190131234609.GZ24863@kib.kiev.ua> <CANCZdfoL=n2Bo-waSfNth2Q-ZN8Ej%2BvZ6_no7QWSRnNfQnAqxA@mail.gmail.com> <CAOfEmZhi%2Bj5D0KvSSE0HjwNZGiko5eGLtviFRdbBrk31g-GB%2Bw@mail.gmail.com> <20190201010117.GA24863@kib.kiev.ua> <CAOfEmZgrt1EzddzooFmdZgV1xyVqwVD1ngNK%2B%2BahwNfRiOV_sw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 01, 2019 at 09:05:37AM +0800, Marcelo Araujo wrote:
> Em sex, 1 de fev de 2019 às 09:01, Konstantin Belousov <kostikbel@gmail.com>
> escreveu:
> 
> > On Fri, Feb 01, 2019 at 08:40:11AM +0800, Marcelo Araujo wrote:
> > > Em sex, 1 de fev de 2019 às 08:36, Warner Losh <imp@bsdimp.com>
> > escreveu:
> > >
> > > >
> > > >
> > > > On Thu, Jan 31, 2019, 4:46 PM Konstantin Belousov <kostikbel@gmail.com
> > > > wrote:
> > > >
> > > >> On Thu, Jan 31, 2019 at 11:32:19PM +0000, Marcelo Araujo wrote:
> > > >> > Author: araujo
> > > >> > Date: Thu Jan 31 23:32:19 2019
> > > >> > New Revision: 343634
> > > >> > URL: https://svnweb.freebsd.org/changeset/base/343634
> > > >> >
> > > >> > Log:
> > > >> >   Mostly a cosmetic change to replace strlen with strnlen.
> > > >> This is not cosmetic, and more, for instance the usage() part of the
> > > >> change
> > > >> does not make any sense to me.
> > > >>
> > > >
> > > > I specifically objected as well and was blown off. What gives?
> > > >
> > >
> > > I have asked you feedback and got none! I will revert the usage() changes
> > > later then.
> >
> > I noted the usage() chunk because it is the first one in the commit and
> > I stopped after I see the obvious issues with it, not because it is the
> > only wrong part.
> >
> 
> Are you implying that all the patch is wrong?
> I have no problem to revert it at all if you give me the right reason, it
> was basically a port from another project that also uses bhyve.

By default, all uses of strncmp() and strncpy() are bugs.
Your commit message have no explanation what the change fixes/improves.

So I looked at the second chunk, for smbios_generic_initializer(). It
also seems to be wrong.  If template_string[i] length is greater than
SMBIOS_MAX_LENGTH, then the copied string is not nul-terminated. If its
length is less than the constant, then what is the point ?

I also looked at the third chunk, smbios_type1_initializer().  I cannot
understand the reasoning behind it, at all.

Only usb_mouse.c is left, I do not expect anything good from it.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190201012111.GB24863>