]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix buffer length in strlcpy()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 8 Apr 2019 16:10:59 +0000 (09:10 -0700)
committerGitHub <noreply@github.com>
Mon, 8 Apr 2019 16:10:59 +0000 (09:10 -0700)
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 <mail@gmelikov.ru>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8595
Closes #8596

lib/libzfs_core/libzfs_core.c

index e03c194826c872e98afd87330b361b92f8e48c43..8a64396b4cc78098a6b554a9bc0ff09121a1acb6 100644 (file)
@@ -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) {