From: Dave Hart Date: Fri, 23 Feb 2024 09:09:57 +0000 (+0000) Subject: ntp_io.c: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a9acb915ab67d95e6f200985ab8abccc07be6c9;p=thirdparty%2Fntp.git ntp_io.c: clean up warnings about math with void * bk: 65d860e50oLAIM2nanq8IAxdAnAhow --- diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index bcd4632ce..42f2d8053 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -4811,6 +4811,7 @@ process_routing_msgs(struct asyncio_reader *reader) #else struct rt_msghdr rtm; char *p; + char *endp; #endif if (scan_addrs_once) { @@ -4863,8 +4864,8 @@ process_routing_msgs(struct asyncio_reader *reader) { msg_type = nh->nlmsg_type; #else - for (p = buffer; - (p + sizeof(struct rt_msghdr)) <= (buffer + cnt); + for (p = buffer, endp = p + cnt; + (p + sizeof(struct rt_msghdr)) <= endp; p += rtm.rtm_msglen) { memcpy(&rtm, p, sizeof(rtm));