Skip to content

Commit

Permalink
Merge pull request #15017 from omoerbeek/rec-shared-ptr-followup
Browse files Browse the repository at this point in the history
rec: followup to #14985: init shared pointers as get() might be passed a nullptr
  • Loading branch information
omoerbeek authored Jan 7, 2025
2 parents 8cc44e9 + 2990eba commit a9b1ba5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pdns/recursordist/aggressive_nsec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ bool AggressiveNSECCache::synthesizeFromNSEC3Wildcard(time_t now, const DNSName&
vState cachedState;

std::vector<DNSRecord> wcSet;
MemRecursorCache::SigRecs wcSignatures;
MemRecursorCache::SigRecs wcSignatures = MemRecursorCache::s_emptySigRecs;

if (g_recCache->get(now, wildcardName, type, MemRecursorCache::RequireAuth, &wcSet, ComboAddress("127.0.0.1"), boost::none, doDNSSEC ? &wcSignatures : nullptr, nullptr, nullptr, &cachedState) <= 0 || cachedState != vState::Secure) {
VLOG(log, name << ": Unfortunately we don't have a valid entry for " << wildcardName << ", so we cannot synthesize from that wildcard" << endl);
Expand All @@ -525,7 +525,7 @@ bool AggressiveNSECCache::synthesizeFromNSECWildcard(time_t now, const DNSName&
vState cachedState;

std::vector<DNSRecord> wcSet;
MemRecursorCache::SigRecs wcSignatures;
MemRecursorCache::SigRecs wcSignatures = MemRecursorCache::s_emptySigRecs;

if (g_recCache->get(now, wildcardName, type, MemRecursorCache::RequireAuth, &wcSet, ComboAddress("127.0.0.1"), boost::none, doDNSSEC ? &wcSignatures : nullptr, nullptr, nullptr, &cachedState) <= 0 || cachedState != vState::Secure) {
VLOG(log, name << ": Unfortunately we don't have a valid entry for " << wildcardName << ", so we cannot synthesize from that wildcard" << endl);
Expand Down Expand Up @@ -812,7 +812,7 @@ bool AggressiveNSECCache::getDenial(time_t now, const DNSName& name, const QType

vState cachedState;
std::vector<DNSRecord> soaSet;
MemRecursorCache::SigRecs soaSignatures;
MemRecursorCache::SigRecs soaSignatures = MemRecursorCache::s_emptySigRecs;
/* we might not actually need the SOA if we find a matching wildcard, but let's not bother for now */
if (g_recCache->get(now, zone, QType::SOA, MemRecursorCache::RequireAuth, &soaSet, who, routingTag, doDNSSEC ? &soaSignatures : nullptr, nullptr, nullptr, &cachedState) <= 0 || cachedState != vState::Secure) {
VLOG(log, name << ": No valid SOA found for " << zone << ", which is the best match for " << name << endl);
Expand Down

0 comments on commit a9b1ba5

Please sign in to comment.