From: Harlan Stenn Date: Sun, 16 Apr 2023 08:27:34 +0000 (-0500) Subject: cleanups X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ceb025a193333e03459ddd9f5a3b4d6a3664298;p=thirdparty%2Fntp.git cleanups bk: 643bb1763LUrbj17nSymVbLpnwuI1g --- diff --git a/ChangeLog b/ChangeLog index a72d2ae3a..20ea42017 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,8 @@ -* [Bug 3806] libntp/mstolfp.c needs bounds checking - - solved numerically instead of using string manipulation --- * [Sec 3807] praecis_parse() in the Palisade refclock driver has a hypothetical input buffer overflow. Reported by ... stenn@ +* [Sec 3806] libntp/mstolfp.c needs bounds checking + - solved numerically instead of using string manipulation * [Bug 3802] ntp-keygen -I default identity modulus bits too small for OpenSSL 3. Reported by rmsh1216@163.com * [Bug 3801] gpsdjson refclock gps_open() device name mishandled. @@ -79,7 +79,8 @@ Integrated patch from Brian Utterback. * [Bug 2525] Turn on automake subdir-objects across the project. * [Bug 2410] syslog an error message on panic exceeded. -* Use recv_buffer instead of the longer recv_space.X_recv_buffer. +* Only define tv_fmt_libbuf() if we will use it. +* Use recv_buffer instead of the longer recv_space.X_recv_buffer. hart/stenn * Disable "embedded NUL in string" warnings in libopts, when we can. * Use https in the AC_INIT URLs in configure.ac. * Implement NTP_FUNC_REALPATH. diff --git a/libntp/mstolfp.c b/libntp/mstolfp.c index daf24a768..c82b7f590 100644 --- a/libntp/mstolfp.c +++ b/libntp/mstolfp.c @@ -35,9 +35,9 @@ mstolfp( ++str; switch (ch) { - case '-': neg = TRUE; - case '+': ++str; - default : break; + case '-': neg = TRUE; + case '+': ++str; + default : break; } if (!isdigit(ch = *(const unsigned char*)str) && (ch != '.')) @@ -67,6 +67,7 @@ mstolfp( * messy to fix in the unit tests. So we stay with the slightly * suboptimal calculation...) */ + /* round */ if (r >= 500) L_ADDUF(lfp, 1u); /* fix sign */ diff --git a/libntp/systime.c b/libntp/systime.c index e2f07f71a..f2d144d3c 100644 --- a/libntp/systime.c +++ b/libntp/systime.c @@ -591,6 +591,8 @@ step_systime( return TRUE; } + +#if SIZEOF_TIME_T > 4 static const char * tv_fmt_libbuf( const struct timeval * ptv @@ -612,6 +614,7 @@ tv_fmt_libbuf( (u_int)ptv->tv_usec); return retv; } +#endif int /*BOOL*/