s4:samldb LDB module - make the "userAccountControl" and "groupType" modify handlers...
[Samba.git] / examples / bind9-patches / 0002-prevent-a-valgrind-uninitialised-memory-warning.patch
blob22f0ce493f2325414d6d591cc99552cc6b277a4d
1 From 31059dee4a706bb4f25f3dccaae7616451eabd8b Mon Sep 17 00:00:00 2001
2 From: Andrew Tridgell <tridge@samba.org>
3 Date: Wed, 17 Feb 2010 10:59:42 +1100
4 Subject: [PATCH 2/5] prevent a valgrind uninitialised memory warning
6 epoll uses a union, so to prevent passing uninitialised data in a
7 syscall we need to zero it before use.
8 ---
9 lib/isc/unix/socket.c | 2 ++
10 1 files changed, 2 insertions(+), 0 deletions(-)
12 diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c
13 index d09fe51..4796ee4 100644
14 --- a/lib/isc/unix/socket.c
15 +++ b/lib/isc/unix/socket.c
16 @@ -652,6 +652,7 @@ watch_fd(isc_socketmgr_t *manager, int fd, int msg) {
17 event.events = EPOLLIN;
18 else
19 event.events = EPOLLOUT;
20 + memset(&event.data, 0, sizeof(event.data));
21 event.data.fd = fd;
22 if (epoll_ctl(manager->epoll_fd, EPOLL_CTL_ADD, fd, &event) == -1 &&
23 errno != EEXIST) {
24 @@ -719,6 +720,7 @@ unwatch_fd(isc_socketmgr_t *manager, int fd, int msg) {
25 event.events = EPOLLIN;
26 else
27 event.events = EPOLLOUT;
28 + memset(&event.data, 0, sizeof(event.data));
29 event.data.fd = fd;
30 if (epoll_ctl(manager->epoll_fd, EPOLL_CTL_DEL, fd, &event) == -1 &&
31 errno != ENOENT) {
33 1.6.3.3