From 9cf7ecbe4fea5162b86e2c78c1a40cca737bc1da Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 24 Jan 2012 15:10:43 +0000 Subject: 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. --- daemon/proto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/proto.c b/daemon/proto.c index bf0d75fd..4ca2b70f 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; -- cgit