From: Robin Geuze Date: Wed, 16 Dec 2020 19:45:37 +0000 (+0100) Subject: Clear the LMDB set state when performing a new lookup or list to prevent corruption... X-Git-Tag: dnsdist-1.6.0-alpha1~29^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8e7491c099daf2643cecbc2b4565803e2696642;p=thirdparty%2Fpdns.git Clear the LMDB set state when performing a new lookup or list to prevent corruption cases --- diff --git a/modules/lmdbbackend/lmdbbackend.cc b/modules/lmdbbackend/lmdbbackend.cc index 9f31242eae..241303d182 100644 --- a/modules/lmdbbackend/lmdbbackend.cc +++ b/modules/lmdbbackend/lmdbbackend.cc @@ -679,6 +679,11 @@ bool LMDBBackend::list(const DNSName &target, int id, bool include_disabled) } d_lookupdomain = target; + + // Make sure we start with fresh data + d_currentrrset.clear(); + d_currentrrsetpos = 0; + return true; } @@ -739,6 +744,10 @@ void LMDBBackend::lookup(const QType &type, const DNSName &qdomain, int zoneId, } d_lookupdomain = hunt; + + // Make sure we start with fresh data + d_currentrrset.clear(); + d_currentrrsetpos = 0; }