Skip to content

Commit

Permalink
Merge pull request #1540 from zonque/cmsg
Browse files Browse the repository at this point in the history
sd-daemon: wipe out memory before using CMSG_NXTHDR()
  • Loading branch information
David Herrmann committed Oct 12, 2015
2 parents 09ba85f + 40f4423 commit b7d18f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libsystemd/sd-daemon/sd-daemon.c
Expand Up @@ -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) {
Expand Down

0 comments on commit b7d18f2

Please sign in to comment.