From 928ee9fe184572a50e686b0c5173edb1b538c627 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Tue, 22 Apr 2014 20:25:39 -0400 Subject: Properly NULL terminate string in zfs_strcmp_pathname The utility cppcheck caught this. Signed-off-by: Richard Yao Signed-off-by: Brian Behlendorf Issue #2330 --- lib/libzfs/libzfs_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index d029b61e7..7f947c186 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -962,7 +962,7 @@ zfs_strcmp_pathname(char *name, char *cmp, int wholedisk) if (name[0] != '/') return (zfs_strcmp_shortname(name, cmp_name, wholedisk)); - strncpy(path_name, name, MAXPATHLEN); + (void) strlcpy(path_name, name, MAXPATHLEN); path_len = strlen(path_name); cmp_len = strlen(cmp_name); -- cgit v1.2.3