From: Brian Behlendorf Date: Mon, 8 Apr 2019 16:10:59 +0000 (-0700) Subject: Fix buffer length in strlcpy() X-Git-Tag: zfs-0.8.0-rc4~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac4985e48dfcf030418df0f0ce9bf153ba12ba03;p=zfs 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 --- 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) {