]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Throw an exception on trying to get an address out of a non-A/AAAA record. 11494/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 1 Apr 2022 13:16:10 +0000 (15:16 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 1 Apr 2022 13:16:10 +0000 (15:16 +0200)
Better that the nullptr deref it was before.

pdns/dnsrecords.cc

index c6afdac811b56b4aea6b554cec82292caf9b6f38..be749b7a8fe9341b99141efb3e8c375202f4e33a 100644 (file)
@@ -994,7 +994,7 @@ ComboAddress getAddr(const DNSRecord& dr, uint16_t defport)
   else if (auto aaaa = getRR<AAAARecordContent>(dr)) {
     return aaaa->getCA(defport);
   }
-  return ComboAddress();
+  throw std::invalid_argument("not an A or AAAA record");
 }
 
 /**