diff --git a/daemon/proto.c b/daemon/proto.c index bf0d75fd0..4ca2b70fd 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -263,6 +263,7 @@ send_error (int errnum, const char *msg) xdrmem_create (&xdr, buf, sizeof buf, XDR_ENCODE); + memset (&hdr, 0, sizeof hdr); hdr.prog = GUESTFS_PROGRAM; hdr.vers = GUESTFS_PROTOCOL_VERSION; hdr.direction = GUESTFS_DIRECTION_REPLY; @@ -315,6 +316,7 @@ reply (xdrproc_t xdrp, char *ret) xdrmem_create (&xdr, buf, sizeof buf, XDR_ENCODE); + memset (&hdr, 0, sizeof hdr); hdr.prog = GUESTFS_PROGRAM; hdr.vers = GUESTFS_PROTOCOL_VERSION; hdr.direction = GUESTFS_DIRECTION_REPLY;