From: Otto Moerbeek Date: Fri, 1 Apr 2022 13:16:10 +0000 (+0200) Subject: Throw an exception on trying to get an address out of a non-A/AAAA record. X-Git-Tag: rec-4.7.0-beta1~22^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d68da99d1a2637e4fbc7532641e488b0e393c860;p=thirdparty%2Fpdns.git Throw an exception on trying to get an address out of a non-A/AAAA record. Better that the nullptr deref it was before. --- diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index c6afdac811..be749b7a8f 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -994,7 +994,7 @@ ComboAddress getAddr(const DNSRecord& dr, uint16_t defport) else if (auto aaaa = getRR(dr)) { return aaaa->getCA(defport); } - return ComboAddress(); + throw std::invalid_argument("not an A or AAAA record"); } /**