summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2011-06-30 15:04:23 +0100
committerDaniel P. Berrange <berrange@redhat.com>2011-06-30 18:04:02 +0100
commitf870c99b4583db0e74b33c9334f195f4feed304b (patch)
treea86a32792752e593f8c281d9f280b734911c8ed5
parentFix leak of JSON object for events (diff)
downloadlibvirt-f870c99b4583db0e74b33c9334f195f4feed304b.tar.gz
libvirt-f870c99b4583db0e74b33c9334f195f4feed304b.tar.bz2
libvirt-f870c99b4583db0e74b33c9334f195f4feed304b.zip
Fix uninitialized value in QEMU monitor FD sending code
The 'char control[CMSG_SPACE(sizeof(int))];' was not being wiped, so could potentially contain uninitialized bytes. While this was harmless in this case, it caused complaints from valgrind * src/qemu/qemu_monitor.c: memset 'control' variable in qemuMonitorIOWriteWithFD
-rw-r--r--src/qemu/qemu_monitor.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index e995d9781..85732621a 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -383,6 +383,7 @@ qemuMonitorIOWriteWithFD(qemuMonitorPtr mon,
struct cmsghdr *cmsg;
memset(&msg, 0, sizeof(msg));
+ memset(control, 0, sizeof(control));
iov[0].iov_base = (void *)data;
iov[0].iov_len = len;