summaryrefslogtreecommitdiff
path: root/src/timesync
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-09-15 23:29:11 +0900
committerLennart Poettering <lennart@poettering.net>2021-09-16 11:47:44 +0200
commitf782eee68aea996c68b8cfeba5f288dae7fc876f (patch)
tree833430397d698b46f6a80df42aa5d2298a156fc3 /src/timesync
parent5aaa55d841249f057fd69e50cf12a52e9781a6ce (diff)
downloadsystemd-f782eee68aea996c68b8cfeba5f288dae7fc876f.tar.gz
journal,network,timesync: fix segfault on 32bit timeval/timespec systems
Fixes #20741.
Diffstat (limited to 'src/timesync')
-rw-r--r--src/timesync/timesyncd-manager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index d7060aaa45..f21c5c316b 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -416,7 +416,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
.iov_base = &ntpmsg,
.iov_len = sizeof(ntpmsg),
};
- CMSG_BUFFER_TYPE(CMSG_SPACE_TIMESPEC) control;
+ /* This needs to be initialized with zero. See #20741. */
+ CMSG_BUFFER_TYPE(CMSG_SPACE_TIMESPEC) control = {};
union sockaddr_union server_addr;
struct msghdr msghdr = {
.msg_iov = &iov,