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
return (0);
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;
}
break;
case 'p':
strncpy(path, optarg, PATH_MAX);
+ path[PATH_MAX - 1] = '\0';
break;
case 'c':
synccaches = 1;
break;
case 't':
strncpy(script, optarg, PATH_MAX);
+ script[PATH_MAX - 1] = '\0';
break;
case 'e':
seed = strtol(optarg, NULL, 0);