timesync: check cmsg length

This commit is contained in:
Yu Watanabe
2021-08-30 19:56:44 +09:00
parent 9365e296fe
commit 37df6d9b8d
+2
View File
@@ -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;
}