summaryrefslogtreecommitdiff
path: root/src/timesync
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-08-29 20:55:44 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-08-30 19:56:44 +0900
commit37df6d9b8d3a8b34bec5346766ab8093c0f0fc26 (patch)
treedd3f93b797e66fb1113ad665ab259e028429cc82 /src/timesync
parent9365e296fe281da45797af89a97627e872fc019d (diff)
downloadsystemd-37df6d9b8d3a8b34bec5346766ab8093c0f0fc26.tar.gz
timesync: check cmsg length
Diffstat (limited to 'src/timesync')
-rw-r--r--src/timesync/timesyncd-manager.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index d7f511ee22..d7060aaa45 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -471,6 +471,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
switch (cmsg->cmsg_type) {
case SCM_TIMESTAMPNS:
+ assert(cmsg->cmsg_len == CMSG_LEN(sizeof(struct timespec)));
+
recv_time = (struct timespec *) CMSG_DATA(cmsg);
break;
}