mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:45:07 -05:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user