summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorcao <[email protected]>2016-10-19 01:31:57 +0800
committerBrian Behlendorf <[email protected]>2016-10-18 10:31:57 -0700
commit1b81ab46d060257288ee9739f7e9c5199deb901b (patch)
treeffd332369ef82b4169e7d252c48dbed8c1ff63b6 /tests
parentdf7492240ab628f245a5400086ab898c8e33b3da (diff)
Fix coverity defects: CID 49339, 153393
CID 49339: Type:Buffer not null terminated CID 153393: Type:Buffer not null terminated Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: <cao.xuewen [email protected]> Closes #5296
Diffstat (limited to 'tests')
-rw-r--r--tests/zfs-tests/cmd/xattrtest/xattrtest.c2
1 files changed, 2 insertions, 0 deletions
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);