1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-26 08:55:18 +03:00

timesync: check cmsg length

(cherry picked from commit 37df6d9b8d)
This commit is contained in:
Yu Watanabe 2021-08-29 20:55:44 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent 0d11d72418
commit 69e624bc05

View File

@ -468,6 +468,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;
}