daemon: Fix use of uninitialized stack data (found by valgrind).

This uninitialized data was also sent over the protocol,
potentially being a serious information leak.
This commit is contained in:
Richard W.M. Jones
2012-01-24 15:10:43 +00:00
parent 84242a8d0b
commit 9cf7ecbe4f

View File

@@ -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;