]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timesync: check cmsg length 20567/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 29 Aug 2021 11:55:44 +0000 (20:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 30 Aug 2021 10:56:44 +0000 (19:56 +0900)
src/timesync/timesyncd-manager.c

index d7f511ee221cf778ff25bbe6be4ebdc9b32e9005..d7060aaa45c5c98a328a352d44bfd614465d954d 100644 (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;
                 }