From da886835bcd84edc21db28b51323dc6f58880128 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Thu, 7 Jul 2022 12:42:33 +0200 Subject: [PATCH] Uninited vars, seen by compiling on jammy --- pdns/lwres.cc | 1 + pdns/recursordist/test-mtasker.cc | 1 + pdns/syncres.cc | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pdns/lwres.cc b/pdns/lwres.cc index c8f2ce2c0d..2a56b3c84e 100644 --- a/pdns/lwres.cc +++ b/pdns/lwres.cc @@ -291,6 +291,7 @@ static LWResult::Result tcpsendrecv(const ComboAddress& ip, TCPOutConnectionMana uint16_t tlen = htons(vpacket.size()); const char *lenP = reinterpret_cast(&tlen); + len = 0; // in case of error localip.sin4.sin_family = ip.sin4.sin_family; if (getsockname(connection.d_handler->getDescriptor(), reinterpret_cast(&localip), &slen) != 0) { return LWResult::Result::PermanentError; diff --git a/pdns/recursordist/test-mtasker.cc b/pdns/recursordist/test-mtasker.cc index 4c71f8240e..6df5fc181c 100644 --- a/pdns/recursordist/test-mtasker.cc +++ b/pdns/recursordist/test-mtasker.cc @@ -51,6 +51,7 @@ BOOST_AUTO_TEST_CASE(test_MtaskerException) MTasker<> mt; mt.makeThread(willThrow, 0); struct timeval now; + now.tv_sec = now.tv_usec = 0; for (;;) { mt.schedule(&now); diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 0ec7e29adc..53fa78d91b 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -5331,7 +5331,7 @@ bool SyncRes::processAnswer(unsigned int depth, LWResult& lwr, const DNSName& qn bool needWildcardProof = false; bool gatherWildcardProof = false; - unsigned int wildcardLabelsCount; + unsigned int wildcardLabelsCount = 0; *rcode = updateCacheFromRecords(depth, lwr, qname, qtype, auth, wasForwarded, ednsmask, state, needWildcardProof, gatherWildcardProof, wildcardLabelsCount, sendRDQuery, remoteIP); if (*rcode != RCode::NoError) { return true; -- 2.47.2