From: Otto Moerbeek Date: Fri, 1 Apr 2022 10:28:43 +0000 (+0200) Subject: Coverity: X-Git-Tag: rec-4.7.0-beta1~22^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=880c96843015503e3005c40fee9fe1e448503bdd;p=thirdparty%2Fpdns.git Coverity: 1469603 Uninitialized scalar field 1445929 Uninitialized scalar field --- diff --git a/pdns/recpacketcache.cc b/pdns/recpacketcache.cc index 8d68e10c58..4e15cbed07 100644 --- a/pdns/recpacketcache.cc +++ b/pdns/recpacketcache.cc @@ -177,14 +177,7 @@ void RecursorPacketCache::insertResponsePacket(unsigned int tag, uint32_t qhash, return; } - struct Entry e(qname, std::move(responsePacket), std::move(query), tcp); - e.d_qhash = qhash; - e.d_type = qtype; - e.d_class = qclass; - e.d_ttd = now + ttl; - e.d_creation = now; - e.d_tag = tag; - e.d_vstate = valState; + struct Entry e(qname, qtype, qclass, std::move(responsePacket), std::move(query), tcp, qhash, now + ttl, now, tag, valState); if (pbdata) { e.d_pbdata = std::move(*pbdata); } diff --git a/pdns/recpacketcache.hh b/pdns/recpacketcache.hh index 2ffdabfbec..ce238a0546 100644 --- a/pdns/recpacketcache.hh +++ b/pdns/recpacketcache.hh @@ -97,8 +97,10 @@ private: }; struct Entry { - Entry(const DNSName& qname, std::string&& packet, std::string&& query, bool tcp) : - d_name(qname), d_packet(std::move(packet)), d_query(std::move(query)), d_tcp(tcp) + Entry(const DNSName& qname, uint16_t qtype, uint16_t qclass, std::string&& packet, std::string&& query, bool tcp, + uint32_t qhash, time_t ttd, time_t now, uint32_t tag, vState vstate) : + d_name(qname), d_packet(std::move(packet)), d_query(std::move(query)), d_ttd(ttd), d_creation(now), + d_qhash(qhash), d_tag(tag), d_type(qtype), d_class(qclass), d_vstate(vstate), d_tcp(tcp) { } diff --git a/pdns/recursor_cache.hh b/pdns/recursor_cache.hh index 56c6991914..bdeca9bb27 100644 --- a/pdns/recursor_cache.hh +++ b/pdns/recursor_cache.hh @@ -73,7 +73,7 @@ private: struct CacheEntry { CacheEntry(const std::tuple& key, bool auth) : - d_qname(std::get<0>(key)), d_netmask(std::get<3>(key).getNormalized()), d_rtag(std::get<2>(key)), d_state(vState::Indeterminate), d_ttd(0), d_qtype(std::get<1>(key)), d_auth(auth), d_submitted(false) + d_qname(std::get<0>(key)), d_netmask(std::get<3>(key).getNormalized()), d_rtag(std::get<2>(key)), d_state(vState::Indeterminate), d_ttd(0), d_orig_ttl{0}, d_qtype(std::get<1>(key)), d_auth(auth), d_submitted(false) { }