From 2bb2a10ba43fbac6c1330f26bf37ab84d1a5b4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 25 Mar 2020 19:06:50 +0100 Subject: [PATCH 1/2] Fix the tv_nsec check in isc_stdtime_get() (cherry picked from commit 0d06a62dd1bffe72b93f3a03c9cbfb57dcb2c20b) --- lib/isc/unix/stdtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/isc/unix/stdtime.c b/lib/isc/unix/stdtime.c index a68ad31b17..80e9f25547 100644 --- a/lib/isc/unix/stdtime.c +++ b/lib/isc/unix/stdtime.c @@ -45,7 +45,7 @@ isc_stdtime_get(isc_stdtime_t *t) { strbuf); } - REQUIRE(ts.tv_sec > 0 && ts.tv_nsec > 0 && ts.tv_nsec < NS_PER_S); + REQUIRE(ts.tv_sec > 0 && ts.tv_nsec >= 0 && ts.tv_nsec < NS_PER_S); *t = (unsigned int)ts.tv_sec; } From e017574b7466ff18b113b0574b26abcdc80e7082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 25 Mar 2020 22:08:50 +0100 Subject: [PATCH 2/2] Correct the typecast of .tv_sec in isc_stdtime_get() --- lib/isc/unix/stdtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/isc/unix/stdtime.c b/lib/isc/unix/stdtime.c index 80e9f25547..e3fefad500 100644 --- a/lib/isc/unix/stdtime.c +++ b/lib/isc/unix/stdtime.c @@ -47,5 +47,5 @@ isc_stdtime_get(isc_stdtime_t *t) { REQUIRE(ts.tv_sec > 0 && ts.tv_nsec >= 0 && ts.tv_nsec < NS_PER_S); - *t = (unsigned int)ts.tv_sec; + *t = (isc_stdtime_t)ts.tv_sec; }