diff options
author | GeLiXin <[email protected]> | 2016-08-02 10:58:42 +0800 |
---|---|---|
committer | Ned Bass <[email protected]> | 2016-09-09 13:21:09 -0700 |
commit | e66b546cb7936f22ca88c457b3e8585275ffe0fd (patch) | |
tree | 719e114b5832afa6a2cdc74af8888706c34db4e2 /lib | |
parent | c23686524f68fc8594610060fff65c747b1e8eda (diff) |
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 <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #4919
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzfs/libzfs_mount.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index 4c1adcd8b..bd874e480 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -1074,7 +1074,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))); } /* |