]> granicus.if.org Git - pdns/commitdiff
rec: Initialize `qhash` to 0 to make coverity happy
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 7 Mar 2017 08:33:06 +0000 (09:33 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 8 Mar 2017 09:01:15 +0000 (10:01 +0100)
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.

pdns/pdns_recursor.cc

index 317b775a920978b2066014e4570a6efb69299947..d038455b5565415eac8161ef98293482d1e8edad 100644 (file)
@@ -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<std::string> policyTags;
   std::unordered_map<string,string> data;