diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-01-24 15:10:43 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-01-24 15:56:19 +0000 |
commit | 9cf7ecbe4fea5162b86e2c78c1a40cca737bc1da (patch) | |
tree | 6db4cebdef7c361506952c25ce2cff683e431a85 | |
parent | 84242a8d0bf9c37e700cd8a3436607dbc7908f1e (diff) | |
download | libguestfs-9cf7ecbe4fea5162b86e2c78c1a40cca737bc1da.tar.gz libguestfs-9cf7ecbe4fea5162b86e2c78c1a40cca737bc1da.tar.xz libguestfs-9cf7ecbe4fea5162b86e2c78c1a40cca737bc1da.zip |
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.
-rw-r--r-- | daemon/proto.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |