From: Remi Gacogne Date: Tue, 7 Mar 2017 08:33:06 +0000 (+0100) Subject: rec: Initialize `qhash` to 0 to make coverity happy X-Git-Tag: rec-4.1.0-alpha1~220^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f57486f1c2c1ca39a668c142c28a623a6696e556;p=thirdparty%2Fpdns.git rec: Initialize `qhash` to 0 to make coverity happy Coverity reports that `qhash` might be used initialized if the packet cache is disabled. It's indeed used to initialize `dc->d_qhash`, which will not be used if the packet cache is disabled so there is no real issue. Still, let's just initialize `qhash` since other tools like Valgrind are very likely to complain about this too. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 317b775a92..d038455b55 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1536,7 +1536,7 @@ static string* doProcessUDPQuestion(const std::string& question, const ComboAddr string response; const struct dnsheader* dh = (struct dnsheader*)question.c_str(); unsigned int ctag=0; - uint32_t qhash; + uint32_t qhash = 0; bool needECS = false; std::vector policyTags; std::unordered_map data;