From 7ff8246f59f86a068ce7daf8881aabc1aecef379 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 26 Mar 2018 17:25:29 +0200 Subject: [PATCH] dnsdist: Work around a false positive in statNodeRespRing() Debian Jessie's compiler reports that `cutoff` might be used uninitialized in `statNodeRespRing()`. This is a false positive, but let's just initialize it no matter what so the compiler stops whining. --- pdns/dnsdist-lua-inspection.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pdns/dnsdist-lua-inspection.cc b/pdns/dnsdist-lua-inspection.cc index d3b14e2c6..93fd8ff24 100644 --- a/pdns/dnsdist-lua-inspection.cc +++ b/pdns/dnsdist-lua-inspection.cc @@ -99,10 +99,8 @@ static void statNodeRespRing(statvisitor_t visitor, unsigned int seconds) { struct timespec cutoff, now; gettime(&now); - if (seconds) { - cutoff = now; - cutoff.tv_sec -= seconds; - } + cutoff = now; + cutoff.tv_sec -= seconds; StatNode root; { -- 2.40.0