aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/zfs/zfs_vfsops.c2
-rw-r--r--tests/zfs-tests/cmd/xattrtest/xattrtest.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c
index 63b7f9230..eb73f3b60 100644
--- a/module/zfs/zfs_vfsops.c
+++ b/module/zfs/zfs_vfsops.c
@@ -553,7 +553,7 @@ zfs_userspace_one(zfs_sb_t *zsb, zfs_userquota_prop_t type,
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;
}
diff --git a/tests/zfs-tests/cmd/xattrtest/xattrtest.c b/tests/zfs-tests/cmd/xattrtest/xattrtest.c
index 68a809f17..991dd066d 100644
--- a/tests/zfs-tests/cmd/xattrtest/xattrtest.c
+++ b/tests/zfs-tests/cmd/xattrtest/xattrtest.c
@@ -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);