svn commit: r314189 - head/lib/libcam
Ngie Cooper (yaneurabeya)
yaneurabeya at gmail.com
Fri Feb 24 21:02:51 UTC 2017
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20170224/01e6f8c4/attachment.sig>
More information about the svn-src-head
mailing list