mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fix coverity defects
1.coverity scan CID:147445 function zfs_do_send in zfs_main.c Buffer not null terminated (BUFFER_SIZE_WARNING) 2.coverity scan CID:147443 function zfs_do_bookmark in zfs_main.c Buffer not null terminated (BUFFER_SIZE_WARNING) 3.coverity scan CID:147660 function main in zinject.c Passing string argv[0] of unknown size to strcpy By the way, the leak of g_zfs is fixed. 4.coverity scan CID: 147442 function make_disks in zpool_vdev.c Buffer not null terminated (BUFFER_SIZE_WARNING) 5.coverity scan CID: 147661 function main in dir_rd_update.c passing string cp1 of unknown size to strcpy Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: luozhengzheng <luo.zhengzheng@zte.com.cn> Closes #5130
This commit is contained in:
committed by
Brian Behlendorf
parent
3ec68a4414
commit
5df39c1e43
@@ -63,6 +63,11 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
cp1 = argv[1];
|
||||
if (strlen(cp1) >= (sizeof (dirpath) - strlen("TMP_DIR"))) {
|
||||
(void) printf("The string length of mount point is "
|
||||
"too large\n");
|
||||
exit(-1);
|
||||
}
|
||||
(void) strcpy(&dirpath[0], (const char *)cp1);
|
||||
(void) strcat(&dirpath[strlen(dirpath)], "TMP_DIR");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user