From ac4985e48dfcf030418df0f0ce9bf153ba12ba03 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 8 Apr 2019 09:10:59 -0700 Subject: [PATCH] Fix buffer length in strlcpy() The length used for the strlcpy() used the size of zv_value when it should have used the size of zc_name. Correct this typo. Reviewed-by: George Melikov Reviewed-by: Jorgen Lundman Reviewed-by: Igor Kozhukhov Signed-off-by: Brian Behlendorf Closes #8595 Closes #8596 --- lib/libzfs_core/libzfs_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libzfs_core/libzfs_core.c b/lib/libzfs_core/libzfs_core.c index e03c19482..8a64396b4 100644 --- a/lib/libzfs_core/libzfs_core.c +++ b/lib/libzfs_core/libzfs_core.c @@ -857,7 +857,7 @@ recv_impl(const char *snapname, nvlist_t *recvdprops, nvlist_t *localprops, ASSERT3S(g_refcount, >, 0); - (void) strlcpy(zc.zc_name, fsname, sizeof (zc.zc_value)); + (void) strlcpy(zc.zc_name, fsname, sizeof (zc.zc_name)); (void) strlcpy(zc.zc_value, snapname, sizeof (zc.zc_value)); if (recvdprops != NULL) {