chiark / gitweb /
sd-daemon: wipe out memory before using CMSG_NXTHDR()
[elogind.git] / src / libelogind / sd-daemon / sd-daemon.c
index 749a3646d709193058ce42f791c568c1d124f4aa..e10444f498eae0efa71bb8a37e9642b704cc0b64 100644 (file)
@@ -460,7 +460,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) {