Date: Fri, 24 Feb 2017 14:17:48 -0700 From: Ian Lepore <ian@freebsd.org> To: "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com> Cc: Ngie Cooper <ngie@FreeBSD.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r314189 - head/lib/libcam Message-ID: <1487971068.25520.45.camel@freebsd.org> In-Reply-To: <769272AC-D30C-4C69-B4D3-9805B9FFC28D@gmail.com> References: <201702240624.v1O6OdRr094467@repo.freebsd.org> <1487950593.25520.20.camel@freebsd.org> <769272AC-D30C-4C69-B4D3-9805B9FFC28D@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2017-02-24 at 13:02 -0800, Ngie Cooper (yaneurabeya) wrote: > > > > On Feb 24, 2017, at 07:36, Ian Lepore <ian@freebsd.org> wrote: > > > > On Fri, 2017-02-24 at 06:24 +0000, Ngie Cooper wrote: > > > > > > Author: ngie > > > Date: Fri Feb 24 06:24:39 2017 > > > New Revision: 314189 > > > URL: https://svnweb.freebsd.org/changeset/base/314189 > > > > > > Log: > > > Fix up NULL/'\0' uses and fix 2 derefs after NULL > > > > > > MFC after: 2 weeks > > > Reported by: Coverity > > > CID: 1018898, 1018899 > > > Differential Revision: https://reviews.freebsd.org/D6142 > > > Sponsored by: Dell EMC Isilon > > > > > > Modified: > > > head/lib/libcam/scsi_cmdparse.c > > > > > > Modified: head/lib/libcam/scsi_cmdparse.c > > > ================================================================= > > > ==== > > > ========= > > > --- head/lib/libcam/scsi_cmdparse.c Fri Feb 24 01:39:12 > > > 2017 > > > (r314188) > > > +++ head/lib/libcam/scsi_cmdparse.c Fri Feb 24 06:24:39 > > > 2017 > > > (r314189) > > > @@ -128,14 +128,14 @@ do_buff_decode(u_int8_t *buff, size_t le > > > *(va_arg(*ap, int *)) = (ARG); \ > > > assigned++; \ > > > } \ > > > - field_name[0] = 0; \ > > > + field_name[0] = '\0'; \ > > Is coverity seriously complaining about using 0 instead of > > '\0'? What > > possible *real* benefit (not just shutting up coverity) does this > > churn > > bring? > Warner made the same comment. > It was actually a combination of issues brought up by Coverity > and coccinelle (badzero.cocci). The forward-NULL CIDs noted were > pointed out by Coverity. The NULL/‘\0’ use issues were pointed out by > coccinelle. > Thanks! > -Ngie Alright. That answers everything except the actual important question. So, again: What *real* benefit does this churn bring? -- Ian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1487971068.25520.45.camel>