Bug 203924 - makefs: Coverity CID 976924: False positive
Summary: makefs: Coverity CID 976924: False positive
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-21 12:47 UTC by scdbackup
Modified: 2017-11-05 20:47 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description scdbackup 2015-10-21 12:47:56 UTC
usr.sbin/makefs/cd9660.c

CID 976924: Memset fill value of '0' (NO_EFFECT)bad_memset: Memset with
   fill value '0' (the zero character).

684        memset(diskStructure.primaryDescriptor.expiration_date, 48, 16UL).
685        diskStructure.primaryDescriptor.expiration_date[16] = 0;

--------------- Source analysis:

This is correct. ECMA-119 8.4.26.1 says:
"If all characters in RBP 1 to 16 of this field are the digit ZERO
 and the number in RBP 17 is zero, it shall mean that the date and
 time are not specified."

"digit ZERO" means ASCII 48 = '0', "zero" means ASCII 0 = NUL.

--------------- Remedy proposal:

In Coverity classify CID 976924 as "False positive" and set its Action
to "Ignore".
Comment 1 Enji Cooper freebsd_committer 2015-10-25 22:12:59 UTC
Bulk taking makefs bugs.
Comment 2 Enji Cooper freebsd_committer 2017-11-05 20:47:22 UTC
Releasing bugs back to the pool.