]> granicus.if.org Git - zfs/commit
Fix coverity defects: CID 147643, 152204, 49339
authorGeLiXin <ge.lixin@zte.com.cn>
Tue, 18 Oct 2016 17:43:22 +0000 (01:43 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 18 Oct 2016 17:43:22 +0000 (10:43 -0700)
commit66826e2285d6ef8162e5cb8e727da5ea2d9f33f2
tree1769d3aa90720089bf3a31c130170da5e9182115
parent1b81ab46d060257288ee9739f7e9c5199deb901b
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
cmd/zpios/zpios_main.c
tests/zfs-tests/tests/functional/ctime/ctime_001_pos.c