From: Bert Hubert Date: Thu, 15 Oct 2009 18:41:40 +0000 (+0000) Subject: don't process any non-existing additional processing X-Git-Tag: rec-3.2~103 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb8965b29acb0e8fe5b380887896f9b387e9ad16;p=pdns don't process any non-existing additional processing git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1436 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index bda6c75ad..b0fe69311 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -1143,12 +1143,14 @@ void SyncRes::addCruft(const string &qname, vector& ret) doResolve(host, *l_doIPv6AP ? QType(QType::ADDR) : QType(QType::A), addit, 1, beenthere); } - sort(addit.begin(), addit.end()); - addit.erase(unique(addit.begin(), addit.end(), uniqueComp), addit.end()); - for(vector::iterator k=addit.begin();k!=addit.end();++k) { - if(k->qtype.getCode()==QType::A || k->qtype.getCode()==QType::AAAA) { - k->d_place=DNSResourceRecord::ADDITIONAL; - ret.push_back(*k); + if(!addit.empty()) { + sort(addit.begin(), addit.end()); + addit.erase(unique(addit.begin(), addit.end(), uniqueComp), addit.end()); + for(vector::iterator k=addit.begin();k!=addit.end();++k) { + if(k->qtype.getCode()==QType::A || k->qtype.getCode()==QType::AAAA) { + k->d_place=DNSResourceRecord::ADDITIONAL; + ret.push_back(*k); + } } } LOG<