From: Remi Gacogne Date: Wed, 29 May 2019 13:41:55 +0000 (+0200) Subject: auth: Check the result of safeGetBBDomainInfo in Bind2Backend::searchRecords() X-Git-Tag: dnsdist-1.4.0-beta1~8^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4a18aa93063f9325859558a2c044d24749db978;p=thirdparty%2Fpdns.git auth: Check the result of safeGetBBDomainInfo in Bind2Backend::searchRecords() There should be no way for it to fail here since we iterate on known domains, but better safe than sorry. Reported by Coverity (CID 1401684). --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index afeeaadef8..21428a4d55 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -1330,7 +1330,10 @@ bool Bind2Backend::searchRecords(const string &pattern, int maxResults, vectord_id, &h); + if (!safeGetBBDomainInfo(i->d_id, &h)) { + continue; + } + shared_ptr rhandle = h.d_records.get(); for(recordstorage_t::const_iterator ri = rhandle->begin(); result.size() < static_cast::size_type>(maxResults) && ri != rhandle->end(); ri++) {