From e3aa9cf9df1a02648cfcb25900d151c2d128db73 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 19 Feb 2015 22:35:50 +0000 Subject: - Bugfix: unixmessage_sender_init didn't initialize b->shorty - byte_zero the ancilbuf's padding to appease valgrind --- src/libunixonacid/unixmessage_sender_flush.c | 2 ++ src/libunixonacid/unixmessage_sender_init.c | 1 + 2 files changed, 3 insertions(+) (limited to 'src') diff --git a/src/libunixonacid/unixmessage_sender_flush.c b/src/libunixonacid/unixmessage_sender_flush.c index b0ad2c9..75412fb 100644 --- a/src/libunixonacid/unixmessage_sender_flush.c +++ b/src/libunixonacid/unixmessage_sender_flush.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -82,6 +83,7 @@ int unixmessage_sender_flush (unixmessage_sender_t *b) { struct cmsghdr *cp = CMSG_FIRSTHDR(&hdr) ; register unsigned int i = 0 ; + byte_zero(ancilbuf, sizeof(ancilbuf)) ; cp->cmsg_level = SOL_SOCKET ; cp->cmsg_type = SCM_RIGHTS ; cp->cmsg_len = CMSG_LEN(nfds * sizeof(int)) ; diff --git a/src/libunixonacid/unixmessage_sender_init.c b/src/libunixonacid/unixmessage_sender_init.c index 07c0bc2..d986f29 100644 --- a/src/libunixonacid/unixmessage_sender_init.c +++ b/src/libunixonacid/unixmessage_sender_init.c @@ -11,4 +11,5 @@ void unixmessage_sender_init (unixmessage_sender_t *b, int fd) b->fds = genalloc_zero ; b->offsets = genalloc_zero ; b->head = 0 ; + b->shorty = 0 ; } -- cgit v1.2.3