From: Otto Moerbeek Date: Mon, 16 Oct 2023 09:06:20 +0000 (+0200) Subject: Check if nrr pointer is valid before using X-Git-Tag: rec-5.0.0-alpha2~5^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13364%2Fhead;p=thirdparty%2Fpdns.git Check if nrr pointer is valid before using Co-authored-by: Remi Gacogne --- diff --git a/pdns/recursordist/syncres.cc b/pdns/recursordist/syncres.cc index f7c56a4e21..79eed8d6af 100644 --- a/pdns/recursordist/syncres.cc +++ b/pdns/recursordist/syncres.cc @@ -2289,7 +2289,7 @@ void SyncRes::getBestNSFromCache(const DNSName& qname, const QType qtype, vector LOG(", not in cache / did not look at cache" << endl); } } - else { + else if (nrr != nullptr) { *flawedNSSet = true; LOG(prefix << qname << ": NS in cache for '" << subdomain << "', but needs glue (" << nrr->getNS() << ") which we miss or is expired" << endl); missing.emplace_back(nrr->getNS());