aboutsummaryrefslogtreecommitdiff
path: root/lib/libzfs/libzfs_sendrecv.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libzfs/libzfs_sendrecv.c')
-rw-r--r--lib/libzfs/libzfs_sendrecv.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c
index ba6eddd12ea7..2d866dfa7238 100644
--- a/lib/libzfs/libzfs_sendrecv.c
+++ b/lib/libzfs/libzfs_sendrecv.c
@@ -4285,9 +4285,9 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
boolean_t recursive;
char *snapname = NULL;
char destsnap[MAXPATHLEN * 2];
- char origin[MAXNAMELEN];
+ char origin[MAXNAMELEN] = {0};
char name[MAXPATHLEN];
- char tmp_keylocation[MAXNAMELEN];
+ char tmp_keylocation[MAXNAMELEN] = {0};
nvlist_t *rcvprops = NULL; /* props received from the send stream */
nvlist_t *oxprops = NULL; /* override (-o) and exclude (-x) props */
nvlist_t *origprops = NULL; /* original props (if destination exists) */
@@ -4303,8 +4303,6 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
#endif
clock_gettime(CLOCK_MONOTONIC_RAW, &begin_time);
- bzero(origin, MAXNAMELEN);
- bzero(tmp_keylocation, MAXNAMELEN);
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
"cannot receive"));
@@ -5228,7 +5226,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap,
* We computed the checksum in the wrong byteorder in
* recv_read() above; do it again correctly.
*/
- bzero(&zcksum, sizeof (zio_cksum_t));
+ memset(&zcksum, 0, sizeof (zio_cksum_t));
fletcher_4_incremental_byteswap(&drr, sizeof (drr), &zcksum);
flags->byteswap = B_TRUE;