From 20831394972a04281f6e28d060fadead9c95080a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 22 Jan 2015 20:11:07 +0000 Subject: [PATCH 1/4] socket_set_epoll_add: initialize all bytes of struct epoll_event This should be a no-op, but it shuts Valgrind up. The reason for the warning is that we fill in event.events and event.data.fd, but the union event.data actually contains more bytes than that. We'll get the same partially initialized union back from the kernel in socket_set_epoll_poll(), where we take events[i].data.fd and ignore the rest. So the current code is safe, but valgrind is right to worry. --- dbus/dbus-socket-set-epoll.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dbus/dbus-socket-set-epoll.c b/dbus/dbus-socket-set-epoll.c index 4cd9a56..07538cb 100644 --- a/dbus/dbus-socket-set-epoll.c +++ b/dbus/dbus-socket-set-epoll.c @@ -144,6 +144,7 @@ socket_set_epoll_add (DBusSocketSet *set, struct epoll_event event; int err; + _DBUS_ZERO (event); event.data.fd = fd; if (enabled) -- 2.1.4