From a4a18aa93063f9325859558a2c044d24749db978 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 29 May 2019 15:41:55 +0200 Subject: [PATCH] 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). --- modules/bindbackend/bindbackend2.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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++) { -- 2.47.2