From a2b6d30e1528687dc1ef5e9212a4c0ba2c5f333a Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 20 Jun 2025 09:15:34 +0200 Subject: [PATCH] Two Coverity issues, the truncation is meant to be Signed-off-by: Otto Moerbeek --- pdns/validate.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pdns/validate.cc b/pdns/validate.cc index 2f83e1fb75..882f84e2a4 100644 --- a/pdns/validate.cc +++ b/pdns/validate.cc @@ -973,12 +973,16 @@ dState getDenial(const cspmap_t &validrrsets, const DNSName& qname, const uint16 bool isRRSIGNotExpired(const time_t now, const RRSIGRecordContent& sig) { - return rfc1982LessThanOrEqual(now, sig.d_sigexpire); + // it's an uint32_t rfc1982 compare, explicitly cast now to uint32_t to avoid Coverity warning + // implicitly converting a time_t to a smaller int. + return rfc1982LessThanOrEqual(static_cast(now), sig.d_sigexpire); } bool isRRSIGIncepted(const time_t now, const RRSIGRecordContent& sig) { - return rfc1982LessThanOrEqual(sig.d_siginception - g_signatureInceptionSkew, now); + // it's an uint32_t rfc1982 compare, explicitly cast now to uint32_t to avoid Coverity warning + // implicitly converting a time_t to a smaller int. + return rfc1982LessThanOrEqual(sig.d_siginception - g_signatureInceptionSkew, static_cast(now)); } namespace { -- 2.47.2