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:
parent
df7492240a
commit
1b81ab46d0
|
@ -553,7 +553,7 @@ zfs_userspace_one(zfs_sb_t *zsb, zfs_userquota_prop_t type,
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
if (type == ZFS_PROP_USEROBJUSED || type == ZFS_PROP_GROUPOBJUSED) {
|
if (type == ZFS_PROP_USEROBJUSED || type == ZFS_PROP_GROUPOBJUSED) {
|
||||||
strncpy(buf, DMU_OBJACCT_PREFIX, DMU_OBJACCT_PREFIX_LEN);
|
strlcpy(buf, DMU_OBJACCT_PREFIX, DMU_OBJACCT_PREFIX_LEN);
|
||||||
offset = DMU_OBJACCT_PREFIX_LEN;
|
offset = DMU_OBJACCT_PREFIX_LEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -168,6 +168,7 @@ parse_args(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
strncpy(path, optarg, PATH_MAX);
|
strncpy(path, optarg, PATH_MAX);
|
||||||
|
path[PATH_MAX - 1] = '\0';
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
synccaches = 1;
|
synccaches = 1;
|
||||||
|
@ -177,6 +178,7 @@ parse_args(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
strncpy(script, optarg, PATH_MAX);
|
strncpy(script, optarg, PATH_MAX);
|
||||||
|
script[PATH_MAX - 1] = '\0';
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
seed = strtol(optarg, NULL, 0);
|
seed = strtol(optarg, NULL, 0);
|
||||||
|
|
Loading…
Reference in New Issue