svn commit: r314189 - head/lib/libcam
Ian Lepore
ian at freebsd.org
Fri Feb 24 21:17:57 UTC 2017
On Fri, 2017-02-24 at 13:02 -0800, Ngie Cooper (yaneurabeya) wrote:
> >
> > On Feb 24, 2017, at 07:36, Ian Lepore <ian at 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
More information about the svn-src-all
mailing list