From 88c4c7a0671afef9016446e0132ba86622929092 Mon Sep 17 00:00:00 2001 From: GeLiXin Date: Tue, 2 Aug 2016 10:58:42 +0800 Subject: [PATCH] Fix call zfs_get_name() with invalid parameter zfs_get_name() expects a parameter of type zfs_handle_t *zhp , but gets an invalid parameter type of zfs_handle_t **zhp actually in libzfs_dataset_cmp(), which may trigger a coredump if called. libzfs_dataset_cmp() working normally so far, just because all the callers only give datasets of type ZFS_TYPE_FILESYSTEM to it, we compared their mountpoint and return, luckily. Signed-off-by: GeLiXin Signed-off-by: Tim Chase Signed-off-by: Brian Behlendorf Closes #4919 --- lib/libzfs/libzfs_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index 5e57adab0..dfb748fc5 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -1094,7 +1094,7 @@ libzfs_dataset_cmp(const void *a, const void *b) if (gotb) return (1); - return (strcmp(zfs_get_name(a), zfs_get_name(b))); + return (strcmp(zfs_get_name(*za), zfs_get_name(*zb))); } /*