reference: switch is_leap_close() from time_t to double

Avoid undefined behavior in the timestamp conversion from double to
time_t in REF_IsLeapSecondClose() with NTP sources configured with a
large offset correction.
This commit is contained in:
Miroslav Lichvar 2024-05-02 13:20:54 +02:00
parent 84d6c7a527
commit adaca0ff19

View file

@ -1291,7 +1291,7 @@ REF_DisableLocal(void)
#define LEAP_SECOND_CLOSE 5
static int
is_leap_close(time_t t)
is_leap_close(double t)
{
return leap_when != 0 &&
t >= leap_when - LEAP_SECOND_CLOSE && t < leap_when + LEAP_SECOND_CLOSE;