From: Peter van Dijk Date: Mon, 23 Sep 2019 07:45:17 +0000 (+0200) Subject: stop using bogus lowestTime, thanks @mnordhoff X-Git-Tag: auth-4.3.0-alpha1~13^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=540078850c8042f9ae79bd70855e12c34bd3492d;p=thirdparty%2Fpdns.git stop using bogus lowestTime, thanks @mnordhoff --- diff --git a/pdns/dnsscope.cc b/pdns/dnsscope.cc index a31106e6cc..4723d8b215 100644 --- a/pdns/dnsscope.cc +++ b/pdns/dnsscope.cc @@ -212,7 +212,7 @@ try typedef map rcodes_t; rcodes_t rcodes; - time_t lowestTime=2000000000, highestTime=0; + time_t lowestTime=0, highestTime=0; time_t lastsec=0; LiveCounts lastcounts; std::unordered_set requestors, recipients, rdnonra; @@ -290,7 +290,8 @@ try lastcounts = lc; } - lowestTime=min((time_t)lowestTime, (time_t)pr.d_pheader.ts.tv_sec); + if(lowestTime) { lowestTime = min((time_t)lowestTime, (time_t)pr.d_pheader.ts.tv_sec); } + else { lowestTime = pr.d_pheader.ts.tv_sec; } highestTime=max((time_t)highestTime, (time_t)pr.d_pheader.ts.tv_sec); QuestionIdentifier qi=QuestionIdentifier::create(pr.getSource(), pr.getDest(), header, qname, qtype);