mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fix coverity defects: CID 49339, 153393
CID 49339: Type:Buffer not null terminated CID 153393: Type:Buffer not null terminated Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: <cao.xuewen cao.xuewen@zte.com.cn> Closes #5296
This commit is contained in:
@@ -168,6 +168,7 @@ parse_args(int argc, char **argv)
|
||||
break;
|
||||
case 'p':
|
||||
strncpy(path, optarg, PATH_MAX);
|
||||
path[PATH_MAX - 1] = '\0';
|
||||
break;
|
||||
case 'c':
|
||||
synccaches = 1;
|
||||
@@ -177,6 +178,7 @@ parse_args(int argc, char **argv)
|
||||
break;
|
||||
case 't':
|
||||
strncpy(script, optarg, PATH_MAX);
|
||||
script[PATH_MAX - 1] = '\0';
|
||||
break;
|
||||
case 'e':
|
||||
seed = strtol(optarg, NULL, 0);
|
||||
|
||||
Reference in New Issue
Block a user