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:
parent
84d6c7a527
commit
adaca0ff19
1 changed files with 1 additions and 1 deletions
|
@ -1291,7 +1291,7 @@ REF_DisableLocal(void)
|
||||||
#define LEAP_SECOND_CLOSE 5
|
#define LEAP_SECOND_CLOSE 5
|
||||||
|
|
||||||
static int
|
static int
|
||||||
is_leap_close(time_t t)
|
is_leap_close(double t)
|
||||||
{
|
{
|
||||||
return leap_when != 0 &&
|
return leap_when != 0 &&
|
||||||
t >= leap_when - LEAP_SECOND_CLOSE && t < leap_when + LEAP_SECOND_CLOSE;
|
t >= leap_when - LEAP_SECOND_CLOSE && t < leap_when + LEAP_SECOND_CLOSE;
|
||||||
|
|
Loading…
Reference in a new issue