diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2015-10-12 15:23:51 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2015-10-12 15:23:51 +0200 |
commit | b7d18f23dfad2856c7e0a0fa9fb3cad29273bffb (patch) | |
tree | c72bd23ff4fd80f0904c38264348dfa6afb7f4c9 | |
parent | 09ba85f55775733f62a695fdbce9b63c67d58a8d (diff) | |
parent | 40f44238924acf4e7a3ddfc1b0b1c111032bb43d (diff) |
Merge pull request #1540 from zonque/cmsg
sd-daemon: wipe out memory before using CMSG_NXTHDR()
-rw-r--r-- | src/libsystemd/sd-daemon/sd-daemon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c index 582fb53529..ae534ba5b9 100644 --- a/src/libsystemd/sd-daemon/sd-daemon.c +++ b/src/libsystemd/sd-daemon/sd-daemon.c @@ -454,7 +454,7 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char (n_fds > 0 ? CMSG_SPACE(sizeof(int) * n_fds) : 0) + (have_pid ? CMSG_SPACE(sizeof(struct ucred)) : 0); - msghdr.msg_control = alloca(msghdr.msg_controllen); + msghdr.msg_control = alloca0(msghdr.msg_controllen); cmsg = CMSG_FIRSTHDR(&msghdr); if (n_fds > 0) { |