HomeFreeBSD

Fix coverity defects: CID 147643, 152204, 49339

Description

Fix coverity defects: CID 147643, 152204, 49339

CID 147643: Type: String not null terminated

  • make sure that the string is null terminated before strlen and fprintf.

CID 152204: Type: Copy into fixed size buffer

  • since strlcpy isn't availabe here, use strncpy and terminate the string manually.

CID 49339: Type: Buffer not null terminated

  • since strlcpy isn't availabe here, terminate the string manually before fprintf.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: GeLiXin <ge.lixin@zte.com.cn>
Closes #5283

Details

Provenance
GeLiXin <ge.lixin@zte.com.cn>Authored on Oct 18 2016, 5:43 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Oct 18 2016, 5:43 PM
Parents
rG1b81ab46d060: Fix coverity defects: CID 49339, 153393
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG66826e2285d6: Fix coverity defects: CID 147643, 152204, 49339 (authored by GeLiXin <ge.lixin@zte.com.cn>).Oct 18 2016, 5:43 PM