]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix CID 1497843: Execution cannot reach this statement 11920/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 9 Sep 2022 07:11:06 +0000 (09:11 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 9 Sep 2022 07:11:06 +0000 (09:11 +0200)
Followup to #11143.

Not a bug per se, but the unreachable code should be guarded by proper #ifdef

pdns/tkey.cc

index f7f439afa4c4635fb0dff3fa7088b7d97bb5161b..7fdd540229f7024a7a0cb8a586ea1976382fb32a 100644 (file)
@@ -16,7 +16,9 @@ void PacketHandler::tkeyHandler(const DNSPacket& p, std::unique_ptr<DNSPacket>&
   TKEYRecordContent tkey_in;
   std::shared_ptr<TKEYRecordContent> tkey_out(new TKEYRecordContent());
   DNSName name;
+#ifdef ENABLE_GSS_TSIG
   bool sign = false;
+#endif
 
   if (!p.getTKEYRecord(&tkey_in, &name)) {
     g_log<<Logger::Error<<"TKEY request but no TKEY RR found"<<endl;
@@ -109,6 +111,7 @@ void PacketHandler::tkeyHandler(const DNSPacket& p, std::unique_ptr<DNSPacket>&
   zrr.dr.d_place = DNSResourceRecord::ANSWER;
   r->addRecord(std::move(zrr));
 
+#ifdef ENABLE_GSS_TSIG
   if (sign)
   {
     TSIGRecordContent trc;
@@ -122,6 +125,7 @@ void PacketHandler::tkeyHandler(const DNSPacket& p, std::unique_ptr<DNSPacket>&
     // this should cause it to lookup name context
     r->setTSIGDetails(trc, name, name.toStringNoDot(), "", false);
   }
+#endif
 
   r->commitD();
 }