From: Otto Moerbeek Date: Fri, 20 Jun 2025 07:15:34 +0000 (+0200) Subject: Two Coverity issues, the truncation is meant to be X-Git-Tag: rec-5.3.0-alpha1~12^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F15700%2Fhead;p=thirdparty%2Fpdns.git Two Coverity issues, the truncation is meant to be Signed-off-by: Otto Moerbeek --- 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 {