]> granicus.if.org Git - pdns/commitdiff
auth: Check the return of getNext() in LdapBackend::getDomainInfo()
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 29 May 2019 12:25:25 +0000 (14:25 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 29 May 2019 12:25:25 +0000 (14:25 +0200)
Reported by Coverity (CID 1401649).

modules/ldapbackend/native.cc

index f69d78dd464bdc032753b9213ff2ecf2d8500c0c..c0f913fa367b5e5dce5812dcfd03a8c7e72d4da2 100644 (file)
@@ -372,7 +372,9 @@ bool LdapBackend::getDomainInfo( const DNSName& domain, DomainInfo& di, bool get
     // search for SOARecord of domain
     filter = "(&(associatedDomain=" + toLower( d_pldap->escape( domain.toStringRootDot() ) ) + ")(SOARecord=*))";
     d_search = d_pldap->search( getArg( "basedn" ), LDAP_SCOPE_SUBTREE, filter, attronly );
-    d_search->getNext( result );
+    if (!d_search->getNext( result )) {
+      return false;
+    }
   }
   catch( LDAPTimeout &lt )
   {